Record Class ParsedArguments

java.lang.Object
java.lang.Record
me.pauleff.common.argparse.ParsedArguments
Record Components:
serverPath - the path to the server folder, if specified
toOnlineMode - true for online conversion, false for offline, or empty when no conversion was requested
copyPlayerDataSourceWorld - the source world folder name to copy player data from, if requested
serverPropertiesChanges - key/value pairs to apply to server.properties; may be empty

public record ParsedArguments(Optional<Path> serverPath, Optional<Boolean> toOnlineMode, Optional<String> copyPlayerDataSourceWorld, Map<String,String> serverPropertiesChanges) extends Record
Holds the successfully parsed CLI options that drive conversion and related operations.
  • Constructor Details

  • Method Details

    • isConversionOperation

      public boolean isConversionOperation()
      Indicates whether an online/offline conversion was requested.
      Returns:
      true if toOnlineMode is present; false otherwise
    • shouldCopyPlayerData

      public boolean shouldCopyPlayerData()
      Indicates whether player data should be copied from another world.
      Returns:
      true if copyPlayerDataSourceWorld is present; false otherwise
    • 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.
    • serverPath

      public Optional<Path> serverPath()
      Returns the value of the serverPath record component.
      Returns:
      the value of the serverPath record component
    • toOnlineMode

      public Optional<Boolean> toOnlineMode()
      Returns the value of the toOnlineMode record component.
      Returns:
      the value of the toOnlineMode record component
    • copyPlayerDataSourceWorld

      public Optional<String> copyPlayerDataSourceWorld()
      Returns the value of the copyPlayerDataSourceWorld record component.
      Returns:
      the value of the copyPlayerDataSourceWorld record component
    • serverPropertiesChanges

      public Map<String,String> serverPropertiesChanges()
      Returns the value of the serverPropertiesChanges record component.
      Returns:
      the value of the serverPropertiesChanges record component