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
-
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
methods
-
fields
-
params
-
docs
-