Record Class Tag
java.lang.Object
java.lang.Record
net.tangly.core.Tag
- Record Components:
namespace- the optional namespace in which the tag is definedname- the name of the tagvalue- the optional value of the tag
The immutable class tag models a tag with a name and a format. Tags provide a powerful approach for multidimensional classifications of values. All fields of a tag are strings.
We provide the tag type to support conversions from string values to Java objects.
A tag without a value is equivalent ot a label.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanhasValue()Return true if the tag has a format otherwise false.@NotNull Stringname()Returns the value of thenamerecord component.static StringReturns the value of thenamespacerecord component.static Stringstatic Tagstatic Tagstatic Tagstatic Tagstatic Tagtext()static Stringtext(@NotNull Collection<Tag> tags) Transforms a collection of tags into their canonical textual representation.final StringtoString()Returns a string representation of this record class.Transforms raw tags textual representation into a set of tags.value()Returns the value of thevaluerecord component.static String
-
Constructor Details
-
Tag
-
-
Method Details
-
text
Transforms a collection of tags into their canonical textual representation.- Parameters:
tags- tags to be transformed- Returns:
- textual representation of the tags
- See Also:
-
toTags
-
namespace
-
name
-
value
-
parse
-
ofEmpty
-
ofEmpty
-
of
-
of
-
hasValue
public boolean hasValue()Return true if the tag has a format otherwise false.- Returns:
- flag indicating if the tag has a format field
-
text
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
namespace
-
name
-
value
-