Record Class DotNetPath

java.lang.Object
java.lang.Record
io.jenkins.plugins.configsplice.engine.xml.DotNetPath
Record Components:
collection - which .NET collection the path addresses
entryName - the literal value of the identifying attribute to match, exactly and case-sensitively. Named for what it holds rather than for one collection's spelling of it: appSettings entries are identified by key and connectionStrings entries by name, and this is either.
attribute - the attribute on the matched <add> whose value is replaced

public record DotNetPath(DotNetPath.Collection collection, String entryName, String attribute) extends Record
A parsed .NET configuration shorthand path (SRS sections 8.2 and 8.3).

Version 1.0 supports exactly two collections. Both resolve to a single attribute on a single <add> element that is a direct child of the top-level collection element:

 appSettings.<key>                          -> /configuration/appSettings/add[@key='...']/@value
 connectionStrings.<name>                    -> /configuration/connectionStrings/add[@name='...']/@connectionString
 connectionStrings.<name>.@providerName       -> /configuration/connectionStrings/add[@name='...']/@providerName
 
  • Constructor Details

    • DotNetPath

      public DotNetPath(DotNetPath.Collection collection, String entryName, String attribute)
      Creates an instance of a DotNetPath record class.
      Parameters:
      collection - the value for the collection record component
      entryName - the value for the entryName record component
      attribute - the value for the attribute record component
  • Method Details

    • equivalentXPath

      public String equivalentXPath()
      The equivalent XPath, used in documentation and diagnostics. Contains no values.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • collection

      public DotNetPath.Collection collection()
      Returns the value of the collection record component.
      Returns:
      the value of the collection record component
    • entryName

      public String entryName()
      Returns the value of the entryName record component.
      Returns:
      the value of the entryName record component
    • attribute

      public String attribute()
      Returns the value of the attribute record component.
      Returns:
      the value of the attribute record component