Module is.codion.framework.domain
Interface Attribute<T>
- Type Parameters:
T- the attribute type
- All Known Subinterfaces:
Column<T>,DerivedAttribute<T>,ForeignKey
public interface Attribute<T>
Typed
Attribute.
Note that attribute names are case-sensitive and Attributes are equal if their
names and entityTypes are equal, the valueClass does not factor into equality.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceProvidesAttributeDefinition.Builderinstances.static interfaceDefines the data type of an Attribute -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Attribute<T>attribute(EntityType entityType, String name, TypeReference<T> typeReference) Creates a newAttribute, associated with the given entityType.static <T> Attribute<T>attribute(EntityType entityType, String name, Class<T> valueClass) Creates a newAttribute, associated with the given entityType.define()name()type()
-
Method Details
-
define
Attribute.AttributeDefiner<T> define()- Returns:
- a
Attribute.AttributeDefinerfor this attribute
-
type
Attribute.Type<T> type()- Returns:
- the attribute type
-
name
String name()- Returns:
- the name of this attribute.
-
entityType
EntityType entityType()- Returns:
- the entity type this Attribute is associated with
-
attribute
static <T> Attribute<T> attribute(EntityType entityType, String name, TypeReference<T> typeReference) Creates a newAttribute, associated with the given entityType.- Type Parameters:
T- the attribute type- Parameters:
entityType- the entityType owning this attributename- the attribute nametypeReference- theTypeReferencerepresenting the attribute value type- Returns:
- a new
Attribute
-
attribute
Creates a newAttribute, associated with the given entityType.- Type Parameters:
T- the attribute type- Parameters:
entityType- the entityType owning this attributename- the attribute namevalueClass- the class representing the attribute value type- Returns:
- a new
Attribute
-