public class RelationshipUtils extends Object
All methods follow the same convention that relationship types are UPPER_SNAKE_CASE and that fields appear in lowerCamelCase. The de-facto Java Bean getter/setter pattern is also assumed when inferring accessor methods.
The utility methods here will all throw aNullPointerException if invoked with null.| Constructor and Description |
|---|
RelationshipUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
inferFieldName(String relationshipType)
Infers the name of the instance variable that corresponds to the given relationship type.
|
static String |
inferGetterName(String relationshipType)
Infers the name of the getter method that corresponds to the given relationship type.
|
static String |
inferRelationshipType(String memberName)
Infers the relationship type that corresponds to the given field or access method name.
|
static String |
inferSetterName(String relationshipType)
Infers the name of the setter method that corresponds to the given relationship type.
|
public static String inferRelationshipType(String memberName)
memberName - The member name from which to infer the relationship typepublic static String inferSetterName(String relationshipType)
relationshipType - The relationship type from which to infer the setter namepublic static String inferGetterName(String relationshipType)
relationshipType - The relationship type from which to infer the getter nameCopyright © 2016 Neo Technology, Inc.. All rights reserved.