Record Class Id
java.lang.Object
java.lang.Record
org.microbean.bean.Id
- Record Components:
types- aBeanTypeListattributes- aListofAttributessalternate- whether thisIdis to be considered an alternaterank- the rank of thisId; oftenRanked.DEFAULT_RANKto indicate no particular rank; alwaysRanked.DEFAULT_RANKifalternateisfalse
- All Implemented Interfaces:
Constable,Attributed,Ranked
public record Id(BeanTypeList types, List<Attributes> attributes, boolean alternate, int rank)
extends Record
implements Attributed, Constable, Ranked
An identifier for a
Bean.- Author:
- Laird Nelson
- See Also:
-
Field Summary
Fields inherited from interface org.microbean.bean.Ranked
DEFAULT_RANK -
Constructor Summary
ConstructorsConstructorDescriptionId(BeanTypeList types, List<Attributes> attributes) Creates a newIdthat is not an alternate and that therefore has a default rank.Id(BeanTypeList types, List<Attributes> attributes, boolean alternate, int rank) Creates a newId. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thealternaterecord component.Returns the value of theattributesrecord component.final Optional<DynamicConstantDesc<Id>> final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intrank()Returns the value of therankrecord component.final StringtoString()Returns a string representation of this record class.types()Returns the value of thetypesrecord component.
-
Constructor Details
-
Id
Creates a newIdthat is not an alternate and that therefore has a default rank.- Parameters:
types- aBeanTypeList; must not benull; must not be emptyattributes- aListofAttributess; must not benull- Throws:
NullPointerException- iftypesorattributesisnull
-
Id
Creates a newId.- Parameters:
types- aBeanTypeList; must not benull; must not be emptyattributes- aListofAttributess; must not benullalternate- whether thisIdis to be considered an alternaterank- the rank of thisId; oftenRanked.DEFAULT_RANKto indicate no particular rank; alwaysRanked.DEFAULT_RANKifalternateisfalse- Throws:
NullPointerException- iftypesorattributesisnull
-
-
Method Details
-
describeConstable
- Specified by:
describeConstablein interfaceConstable
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
types
-
attributes
Returns the value of theattributesrecord component.- Specified by:
attributesin interfaceAttributed- Returns:
- the value of the
attributesrecord component
-
alternate
-
rank
-