Record Class ElementServiceKey<ServiceT>
java.lang.Object
java.lang.Record
dev.getelements.elements.sdk.record.ElementServiceKey<ServiceT>
- Type Parameters:
ServiceT
- the type of the service- Record Components:
type
- the type of the servicename
- the name of the service
A record type which represents a key for a service.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionElementServiceKey
(Class<ServiceT> type, String name) Creates an instance of aElementServiceKey
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.static Stream
<ElementServiceKey<?>> from
(ElementServiceRecord elementServiceRecord) Gets allElementServiceKey
isntances fom a singleElementServiceRecord
.final int
hashCode()
Returns a hash code value for this object.boolean
isNamed()
Returns true if the service is named.name()
Returns the value of thename
record component.final String
toString()
Returns a string representation of this record class.static Optional
<ElementServiceKey<?>> tryParse
(ElementRecord elementRecord, String designatedServiceKeyString) Parses the string representing theElementServiceKey
.type()
Returns the value of thetype
record component.
-
Field Details
-
TYPE_DESIGNATION
Specifies the name separator.- See Also:
-
SERVICE_NAME_SEPARATOR
Service name separator.- See Also:
-
-
Constructor Details
-
Method Details
-
isNamed
public boolean isNamed()Returns true if the service is named.- Returns:
- true if named, false otherwise
-
from
Gets allElementServiceKey
isntances fom a singleElementServiceRecord
.- Parameters:
elementServiceRecord
- theElementServiceRecord
- Returns:
- the
ElementServiceKey
-
tryParse
public static Optional<ElementServiceKey<?>> tryParse(ElementRecord elementRecord, String designatedServiceKeyString) Parses the string representing theElementServiceKey
.- Parameters:
elementRecord
- the record representing theElement
.designatedServiceKeyString
- theString
representing theElementServiceKey
- Returns:
- the
ElementServiceKey
-
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
public final int 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)
. -
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-