Interface PropertyMetadata
- All Superinterfaces:
Comparable<PropertyMetadata>
- All Known Implementing Classes:
BuilderMetadata
,PropertyMetadataImpl
Represents runtime information for a certain property. This contains all
metadata that may be needed.
- Author:
- Oliver Wolff
-
Method Summary
Modifier and TypeMethodDescriptionDefines the the way how to deal with equality regarding PropertySupport.assertValueSet(Object)In case there is a collectionWrapper defined the generated values will implicitly wrapped in the corresponding collection class defined by that wrapper.de.cuioss.test.generator.TypedGenerator<?>
getName()
Identifies the name of the propertyDefines the way properties are to be written / readClass<?>
de.cuioss.tools.property.PropertyMemberInfo
Indicates the way the corresponding property is subject to the contracts regarding the canonical Object methods likeObject.equals(Object)
,Object.hashCode()
andObject.toString()
and theSerializable
contract.de.cuioss.tools.property.PropertyReadWrite
boolean
boolean
Indicates that the attribute is required.next()
Generates a next random value Similar toTypedGenerator.next()
but in case there is agetCollectionType()
that is notCollectionType.NO_ITERABLE
it wraps the content of the contained generator into a the corresponding collectionWrapper, seeCollectionType.nextIterable(CollectionGenerator)
Class<?>
de.cuioss.test.generator.impl.CollectionGenerator<?>
Methods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
getName
Identifies the name of the property- Returns:
- the actual name of the property, must never be null nor empty
-
getPropertyClass
Class<?> getPropertyClass()- Returns:
- the type of the property. This can either be the actual type, in case
getCollectionType()
isCollectionType.NO_ITERABLE
, the component-type in case ofCollectionType.ARRAY_MARKER
or the type argument for a collection for the otherCollectionType
s, seenext()
andresolveActualClass()
-
next
Generates a next random value Similar toTypedGenerator.next()
but in case there is agetCollectionType()
that is notCollectionType.NO_ITERABLE
it wraps the content of the contained generator into a the corresponding collectionWrapper, seeCollectionType.nextIterable(CollectionGenerator)
- Returns:
- the next generated value
-
resolveActualClass
Class<?> resolveActualClass()- Returns:
- The actual class of the property. PropertyMetadata can always be used directly or the data can be implicitly wrapped into a collection or an array. This method computes the actual class of the property combining both informations
-
resolveCollectionGenerator
de.cuioss.test.generator.impl.CollectionGenerator<?> resolveCollectionGenerator()- Returns:
- a new instance of
CollectionGenerator
wrapping the contained generator;
-
getGenerator
de.cuioss.test.generator.TypedGenerator<?> getGenerator()- Returns:
- the wrapped
TypedGenerator
to dynamically create properties.
-
isDefaultValue
boolean isDefaultValue()- Returns:
- boolean indicating whether the attribute defines a default-value. Default is false.
-
isRequired
boolean isRequired()Indicates that the attribute is required.- Returns:
- boolean indicating whether the attribute is required, defaults to false.
-
getPropertyAccessStrategy
Defines the way properties are to be written / read- Returns:
- the
PropertyAccessStrategy
, must never be null, defaults toPropertyAccessStrategy.BEAN_PROPERTY
-
getCollectionType
In case there is a collectionWrapper defined the generated values will implicitly wrapped in the corresponding collection class defined by that wrapper.- Returns:
- the
CollectionType
represented by thisPropertyMetadata
. Must never be null but may beCollectionType.NO_ITERABLE
-
getPropertyMemberInfo
de.cuioss.tools.property.PropertyMemberInfo getPropertyMemberInfo()Indicates the way the corresponding property is subject to the contracts regarding the canonical Object methods likeObject.equals(Object)
,Object.hashCode()
andObject.toString()
and theSerializable
contract. The default isPropertyMemberInfo.DEFAULT
- Returns:
- the
PropertyMemberInfo
, must never be null
-
getPropertyReadWrite
de.cuioss.tools.property.PropertyReadWrite getPropertyReadWrite()- Returns:
PropertyReadWrite
indicating whether a property can be read or written too, defaults toPropertyReadWrite.READ_WRITE
-
getAssertionStrategy
Defines the the way how to deal with equality regarding PropertySupport.assertValueSet(Object)- Returns:
- the
AssertionStrategy
, defaults toAssertionStrategy.DEFAULT
-