java.lang.Object
java.lang.Record
org.microbean.bean.Constant<I>
-
Field Summary
Fields inherited from interface org.microbean.bean.Aggregate
EMPTY_ASSIGNMENTS, EMPTY_DEPENDENCIES
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal I
Creates a new contextual instance, possibly using the suppliedRequest
, if it is non-null
, to acquire its dependencies.final Optional
<DynamicConstantDesc<I>> Returns anOptional
containing the nominal descriptor for this instance, if one can be constructed, or an emptyOptional
if one cannot be constructed.final void
final boolean
destroys()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thesingleton
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.microbean.bean.Aggregate
assign, dependencies
-
Constructor Details
-
Constant
Creates an instance of aConstant
record class.- Parameters:
singleton
- the value for thesingleton
record component
-
-
Method Details
-
create
Description copied from interface:Factory
Creates a new contextual instance, possibly using the suppliedRequest
, if it is non-null
, to acquire its dependencies.Implementations of this method must not call
Factory.singleton()
.Implementations of this method should consider calling
Creation.created(Object)
on the suppliedRequest
with the contextual instance about to be returned. -
destroys
Description copied from interface:Factory
-
destroy
-
describeConstable
Description copied from interface:Factory
Returns anOptional
containing the nominal descriptor for this instance, if one can be constructed, or an emptyOptional
if one cannot be constructed.The default implementation of this method returns an
Optional
that contains a dynamic constant representing an invocation of the implementation's constructor that takes no arguments. The resolution of this dynamic constant is undefined if the implementation does not declare such a constructor.- Specified by:
describeConstable
in interfaceConstable
- Specified by:
describeConstable
in interfaceFactory<I>
- Returns:
- an
Optional
containing the nominal descriptor for this instance, if one can be constructed, or an emptyOptional
if one cannot be constructed
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
singleton
Returns the value of thesingleton
record component.
-