Package com.cleanroommc.gradle.api.names
Record Class NamesSource
java.lang.Object
java.lang.Record
com.cleanroommc.gradle.api.names.NamesSource
public record NamesSource(String id, Map<String,String> methods, Map<String,String> fields, Map<String,String> params, Map<String,String> docs)
extends Record
A resolved set of SRG to name mappings plus a canonical identity string, decoupled from where the
names came from (MCP CSVs or a hand-edited Tiny2 file).
The id is the load-bearing part of the mapping-identity feature: patch sets stay at the named (MCP/custom) level and record the id of the names they were generated in, so the pipeline can refuse to apply patches against a base that was named differently. Ids take the form:
mcp:<channel>_<version>which is derived from themcpMappingsdependency notationtiny2:<first-12-hex-of-sha256-of-file>which is a sha256 content hash of the Tiny2 file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondocs()Returns the value of thedocsrecord component.final booleanIndicates whether some other object is "equal to" this one.fields()Returns the value of thefieldsrecord component.All member and parameter names merged into a single srg -> name lookup, for source renaming.static NamesSourceResolves a names source from a Tiny2 file.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.static Stringmethods()Returns the value of themethodsrecord component.params()Returns the value of theparamsrecord component.static Stringfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
NamesSource
public NamesSource(String id, Map<String, String> methods, Map<String, String> fields, Map<String, String> params, Map<String, String> docs) Creates an instance of aNamesSourcerecord class.- Parameters:
id- the value for theidrecord componentmethods- the value for themethodsrecord componentfields- the value for thefieldsrecord componentparams- the value for theparamsrecord componentdocs- the value for thedocsrecord component
-
-
Method Details
-
fromTiny2
Resolves a names source from a Tiny2 file. -
tiny2Id
-
mcpId
-
flatNames
All member and parameter names merged into a single srg -> name lookup, for source renaming. -
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
methods
Returns the value of themethodsrecord component.- Returns:
- the value of the
methodsrecord component
-
fields
Returns the value of thefieldsrecord component.- Returns:
- the value of the
fieldsrecord component
-
params
Returns the value of theparamsrecord component.- Returns:
- the value of the
paramsrecord component
-
docs
Returns the value of thedocsrecord component.- Returns:
- the value of the
docsrecord component
-