Contents
Record Class Id
java.lang.Object
java.lang.Record
org.microbean.bean.Id
- Record Components:
types
- aBeanTypeList
attributes
- aList
ofAttributes
salternate
- whether thisId
is to be considered an alternaterank
- the rank of thisId
; oftenRanked.DEFAULT_RANK
to indicate no particular rank; alwaysRanked.DEFAULT_RANK
ifalternate
isfalse
- 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 newId
that 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 TypeMethodDescriptionboolean
Returns the value of thealternate
record component.Returns the value of theattributes
record component.final Optional
<DynamicConstantDesc<Id>> final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
rank()
Returns the value of therank
record component.final String
toString()
Returns a string representation of this record class.types()
Returns the value of thetypes
record component.
-
Constructor Details
-
Id
Creates a newId
that is not an alternate and that therefore has a default rank.- Parameters:
types
- aBeanTypeList
; must not benull
; must not be emptyattributes
- aList
ofAttributes
s; must not benull
- Throws:
NullPointerException
- iftypes
orattributes
isnull
-
Id
Creates a newId
.- Parameters:
types
- aBeanTypeList
; must not benull
; must not be emptyattributes
- aList
ofAttributes
s; must not benull
alternate
- whether thisId
is to be considered an alternaterank
- the rank of thisId
; oftenRanked.DEFAULT_RANK
to indicate no particular rank; alwaysRanked.DEFAULT_RANK
ifalternate
isfalse
- Throws:
NullPointerException
- iftypes
orattributes
isnull
-
-
Method Details
-
describeConstable
- Specified by:
describeConstable
in 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 thecompare
method from their corresponding wrapper classes. -
types
-
attributes
Returns the value of theattributes
record component.- Specified by:
attributes
in interfaceAttributed
- Returns:
- the value of the
attributes
record component
-
alternate
-
rank
-