Package hydra.packaging
Class TypeDefinition
- java.lang.Object
-
- hydra.packaging.TypeDefinition
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<TypeDefinition>
public class TypeDefinition extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<TypeDefinition>
A type-level definition, including a name and the type scheme- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description TypeSchemebodyThe type scheme being definedstatic NameBODYName of thehydra.packaging.TypeDefinition.bodyfield.Optional<EntityMetadata>metadataOptional documentation and lifecycle metadata for the type definitionstatic NameMETADATAName of thehydra.packaging.TypeDefinition.metadatafield.NamenameThe name of the typestatic NameNAMEName of thehydra.packaging.TypeDefinition.namefield.static NameTYPE_Name of thehydra.packaging.TypeDefinitiontype.
-
Constructor Summary
Constructors Constructor Description TypeDefinition(Name name, Optional<EntityMetadata> metadata, TypeScheme body)Constructs an immutableTypeDefinition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(TypeDefinition other)booleanequals(java.lang.Object other)inthashCode()TypeDefinitionwithBody(TypeScheme body)Returns a copy of thisTypeDefinitionwithbodyreplaced.TypeDefinitionwithMetadata(Optional<EntityMetadata> metadata)Returns a copy of thisTypeDefinitionwithmetadatareplaced.TypeDefinitionwithName(Name name)Returns a copy of thisTypeDefinitionwithnamereplaced.
-
-
-
Field Detail
-
TYPE_
public static final Name TYPE_
Name of thehydra.packaging.TypeDefinitiontype.
-
NAME
public static final Name NAME
Name of thehydra.packaging.TypeDefinition.namefield.
-
METADATA
public static final Name METADATA
Name of thehydra.packaging.TypeDefinition.metadatafield.
-
BODY
public static final Name BODY
Name of thehydra.packaging.TypeDefinition.bodyfield.
-
name
public final Name name
The name of the type
-
metadata
public final Optional<EntityMetadata> metadata
Optional documentation and lifecycle metadata for the type definition
-
body
public final TypeScheme body
The type scheme being defined
-
-
Constructor Detail
-
TypeDefinition
public TypeDefinition(Name name, Optional<EntityMetadata> metadata, TypeScheme body)
Constructs an immutableTypeDefinition.- Parameters:
name- The name of the typemetadata- Optional documentation and lifecycle metadata for the type definitionbody- The type scheme being defined
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(TypeDefinition other)
- Specified by:
compareToin interfacejava.lang.Comparable<TypeDefinition>
-
withName
public TypeDefinition withName(Name name)
Returns a copy of thisTypeDefinitionwithnamereplaced.
-
withMetadata
public TypeDefinition withMetadata(Optional<EntityMetadata> metadata)
Returns a copy of thisTypeDefinitionwithmetadatareplaced.
-
withBody
public TypeDefinition withBody(TypeScheme body)
Returns a copy of thisTypeDefinitionwithbodyreplaced.
-
-