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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal ICreates a new contextual instance, possibly using the suppliedRequest, if it is non-null, to acquire its dependencies.final Optional<DynamicConstantDesc<I>> Returns anOptionalcontaining the nominal descriptor for this instance, if one can be constructed, or an emptyOptionalif one cannot be constructed.final voidfinal booleandestroys()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thesingletonrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.microbean.bean.Aggregate
assign, dependencies
-
Constructor Details
-
Constant
Creates an instance of aConstantrecord class.- Parameters:
singleton- the value for thesingletonrecord component
-
-
Method Details
-
create
Description copied from interface:FactoryCreates 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 suppliedRequestwith the contextual instance about to be returned. -
destroys
Description copied from interface:Factory -
destroy
-
describeConstable
Description copied from interface:FactoryReturns anOptionalcontaining the nominal descriptor for this instance, if one can be constructed, or an emptyOptionalif one cannot be constructed.The default implementation of this method returns an
Optionalthat 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:
describeConstablein interfaceConstable- Specified by:
describeConstablein interfaceFactory<I>- Returns:
- an
Optionalcontaining the nominal descriptor for this instance, if one can be constructed, or an emptyOptionalif 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 thesingletonrecord component.
-