Package net.mcreator.workspace.elements
Record Class TagElement
java.lang.Object
java.lang.Record
net.mcreator.workspace.elements.TagElement
- All Implemented Interfaces:
IElement
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionTagElement
(TagType type, String resourcePath) Creates an instance of aTagElement
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
entryFromMappableElement
(MappableElement element) static MappableElement
entryToMappableElement
(Workspace workspace, TagType type, String entry) boolean
Indicates whether some other object is "equal to" this one.static TagElement
fromString
(String raw) static String
getEntryName
(String rawData) getMinecraftNamespace
(Workspace workspace) getName()
int
hashCode()
Returns a hash code value for this object.static boolean
isEntryManaged
(String rawData) static String
makeEntryManaged
(String rawData) static String
normalizeTag
(String input) Utility method for normalizing tag name.Returns the value of theresourcePath
record component.toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.
-
Constructor Details
-
TagElement
Creates an instance of aTagElement
record class.- Parameters:
type
- the value for thetype
record componentresourcePath
- the value for theresourcePath
record component
-
-
Method Details
-
getName
-
getMCreatorNamespace
-
getMinecraftNamespace
-
hashCode
public 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)
. -
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. -
entryFromMappableElement
-
entryToMappableElement
public static MappableElement entryToMappableElement(Workspace workspace, TagType type, String entry) -
isEntryManaged
-
makeEntryManaged
-
getEntryName
-
fromString
-
normalizeTag
Utility method for normalizing tag name. If input does not start with # or TAG: prefix, normalization is not performed as it is assumed input is not a tag.When input with TAG: (legacy use) prefix is provided, prefix is changed to #.
In all cases, if no namespace is provided in the input, minecraft: namespace is added.
- Parameters:
input
- Tag name to normalize- Returns:
- Normalized tag name
-
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
resourcePath
Returns the value of theresourcePath
record component.- Returns:
- the value of the
resourcePath
record component
-