Record Class Id
java.lang.Object
java.lang.Record
org.microbean.bean.Id
- Record Components:
types
- aBeanTypeList
attributes
- aList
ofNamedAttributeMap
sgoverningScopeId
- aNamedAttributeMap
identifying the scope to which thisId
logically belongsalternate
- whether thisId
is to be considered an alternaterank
- the rank of thisId
- All Implemented Interfaces:
Constable
,Ranked
,ScopeMember
public record Id(BeanTypeList types, List<NamedAttributeMap<?>> attributes, NamedAttributeMap<?> governingScopeId, boolean alternate, int rank)
extends Record
implements Constable, Ranked, ScopeMember
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<NamedAttributeMap<?>> attributes, NamedAttributeMap<?> governingScopeId) Creates a newId
that is not an alternate and that has a default rank.Id
(BeanTypeList types, List<NamedAttributeMap<?>> attributes, NamedAttributeMap<?> governingScopeId, boolean alternate, int rank) Creates a newId
.Id
(BeanTypeList types, List<NamedAttributeMap<?>> attributes, NamedAttributeMap<?> governingScopeId, int rank) Creates a newId
that is not an alternate. -
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.Returns the value of thegoverningScopeId
record component.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.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.microbean.scope.ScopeMember
governedBy
-
Constructor Details
-
Id
public Id(BeanTypeList types, List<NamedAttributeMap<?>> attributes, NamedAttributeMap<?> governingScopeId) Creates a newId
that is not an alternate and that has a default rank.- Parameters:
types
- aBeanTypeList
; must not benull
; must not be emptyattributes
- aList
ofNamedAttributeMap
s; must not benull
governingScopeId
- aNamedAttributeMap
identifying the scope to which thisId
logically belongs; must not benull
- Throws:
NullPointerException
- iftypes
,attributes
, orgoverningScopeId
isnull
-
Id
public Id(BeanTypeList types, List<NamedAttributeMap<?>> attributes, NamedAttributeMap<?> governingScopeId, int rank) Creates a newId
that is not an alternate.- Parameters:
types
- aBeanTypeList
; must not benull
; must not be emptyattributes
- aList
ofNamedAttributeMap
s; must not benull
governingScopeId
- aNamedAttributeMap
identifying the scope to which thisId
logically belongs; must not benull
rank
- the rank of thisId
- Throws:
NullPointerException
- iftypes
,attributes
, orgoverningScopeId
isnull
-
Id
public Id(BeanTypeList types, List<NamedAttributeMap<?>> attributes, NamedAttributeMap<?> governingScopeId, boolean alternate, int rank) Creates a newId
.- Parameters:
types
- aBeanTypeList
; must not benull
; must not be emptyattributes
- aList
ofNamedAttributeMap
s; must not benull
governingScopeId
- aNamedAttributeMap
identifying the scope to which thisId
logically belongs; must not benull
alternate
- whether thisId
is to be considered an alternaterank
- the rank of thisId
- Throws:
NullPointerException
- iftypes
,attributes
, orgoverningScopeId
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.- Returns:
- the value of the
attributes
record component
-
governingScopeId
Returns the value of thegoverningScopeId
record component.- Specified by:
governingScopeId
in interfaceScopeMember
- Returns:
- the value of the
governingScopeId
record component
-
alternate
-
rank
-