Package com.google.javascript.jscomp
Record Class JsMessage.PlaceholderReference
java.lang.Object
java.lang.Record
com.google.javascript.jscomp.JsMessage.PlaceholderReference
- All Implemented Interfaces:
JsMessage.Part
- Enclosing class:
JsMessage
public static record JsMessage.PlaceholderReference(String storedPlaceholderName, boolean canonicalFormat)
extends Record
implements JsMessage.Part
A reference to a placeholder in a translatable message.
-
Constructor Summary
ConstructorsConstructorDescriptionPlaceholderReference(String storedPlaceholderName, boolean canonicalFormat) Creates an instance of aPlaceholderReferencerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecanonicalFormatrecord component.createForCanonicalName(String name) final booleanIndicates whether some other object is "equal to" this one.Gets the name of the placeholder as it would appear in XMB or XTB files, and also the form it takes when generating message IDs.Gets the name of the placeholder as it would appear in JS code.Gets the literal string for this message part.final inthashCode()Returns a hash code value for this object.booleanbooleanTrue for placeholders, false for literal string parts.Returns the value of thestoredPlaceholderNamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PlaceholderReference
Creates an instance of aPlaceholderReferencerecord class.- Parameters:
storedPlaceholderName- the value for thestoredPlaceholderNamerecord componentcanonicalFormat- the value for thecanonicalFormatrecord component
-
-
Method Details
-
getStoredPlaceholderName
-
isCanonicalFormat
@InlineMe(replacement="this.canonicalFormat()") public boolean isCanonicalFormat() -
createForCanonicalName
-
isPlaceholder
public boolean isPlaceholder()Description copied from interface:JsMessage.PartTrue for placeholders, false for literal string parts.- Specified by:
isPlaceholderin interfaceJsMessage.Part
-
getJsPlaceholderName
Description copied from interface:JsMessage.PartGets the name of the placeholder as it would appear in JS code.In JS code placeholders are in lower camel case with zero or more trailing numeric suffixes (e.g. myPlaceholderName_123_456).
- Specified by:
getJsPlaceholderNamein interfaceJsMessage.Part- Returns:
- the name for a placeholder
-
getCanonicalPlaceholderName
Description copied from interface:JsMessage.PartGets the name of the placeholder as it would appear in XMB or XTB files, and also the form it takes when generating message IDs.This format is UPPER_SNAKE_CASE.
- Specified by:
getCanonicalPlaceholderNamein interfaceJsMessage.Part- Returns:
- the name for a placeholder
-
getString
Description copied from interface:JsMessage.PartGets the literal string for this message part.- Specified by:
getStringin interfaceJsMessage.Part- Returns:
- the literal string for
JsMessage.StringPart.
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
storedPlaceholderName
Returns the value of thestoredPlaceholderNamerecord component.- Returns:
- the value of the
storedPlaceholderNamerecord component
-
canonicalFormat
public boolean canonicalFormat()Returns the value of thecanonicalFormatrecord component.- Returns:
- the value of the
canonicalFormatrecord component
-