Package org.coliper.ibean
Class IBeanFieldMetaInfo
- java.lang.Object
-
- org.coliper.ibean.IBeanFieldMetaInfo
-
public class IBeanFieldMetaInfo extends Object
Meta description of a field belonging to an IBean, more precisely does it provide name, type, getter method and setter method of the field.This class is created via constructor and is then immutable.
-
-
Constructor Summary
Constructors Constructor Description IBeanFieldMetaInfo(String fieldName, Class<?> fieldType, Method getterMethod, Method setterMethod, int ordinal)Creates a newIBeanFieldMetaInfoby providing all required meta information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Compares this instance with any other object, preferably with anotherIBeanFieldMetaInfo.StringfieldName()Provides the name of the field belonging to the IBean type.Class<?>fieldType()Provides the type of the field.MethodgetterMethod()Provides the getter method in the bean type related to the field.inthashCode()intordinal()Provides the sorting index of the field within itsIBeanTypeMetaInfo.MethodsetterMethod()Provides the setter method in the bean type related to the field.StringtoString()
-
-
-
Constructor Detail
-
IBeanFieldMetaInfo
public IBeanFieldMetaInfo(String fieldName, Class<?> fieldType, Method getterMethod, Method setterMethod, int ordinal)
Creates a newIBeanFieldMetaInfoby providing all required meta information.- Parameters:
fieldName- the case-sensitive name of the fieldfieldType- the type of the fieldgetterMethod- the related getter method in the bean typesetterMethod- the related setter method in the bean typeordinal- the sorting index of the field within itsIBeanTypeMetaInfo
-
-
Method Detail
-
fieldName
public String fieldName()
Provides the name of the field belonging to the IBean type.- Returns:
- some label that complies to the rules for field names defined in the bean style; usually some camel case string
-
getterMethod
public Method getterMethod()
Provides the getter method in the bean type related to the field.- Returns:
- a
Methodcontained in the bean interface
-
setterMethod
public Method setterMethod()
Provides the setter method in the bean type related to the field.- Returns:
- a
Methodcontained in the bean interface
-
fieldType
public Class<?> fieldType()
Provides the type of the field.- Returns:
- any allowed primitive or object type that complies to the bean
style. Usually only
voidis forbidden.
-
ordinal
public int ordinal()
Provides the sorting index of the field within itsIBeanTypeMetaInfo.- Returns:
- some zero based positive integer
-
equals
public boolean equals(Object obj)
Compares this instance with any other object, preferably with anotherIBeanFieldMetaInfo. TwoIBeanFieldMetaInfoare considered equal if field name, field type and ordinal are equal.- Overrides:
equalsin classObject- See Also:
Object.equals(java.lang.Object)
-
-