HyCodeYourTale
classpublicPriority 3

MacroCommandReplacement

com.hypixel.hytale.builtin.commandmacro.MacroCommandReplacement

3

Methods

3

Public Methods

3

Fields

2

Constructors

Constructors

public
MacroCommandReplacement(String nameOfReplacingArg, String stringToReplaceWithValue, String optionalArgumentKey)
public
MacroCommandReplacement(String replacementKey, String stringToReplaceWithValue)

Methods

Public Methods (3)

public
String getNameOfReplacingArg()
public
String getOptionalArgumentKey()
@Nullable
public
String getStringToReplaceWithValue()

Fields

Private/Package Fields (3)

privateString nameOfReplacingArg
privateString optionalArgumentKey
privateString stringToReplaceWithValue

Source Code

package com.hypixel.hytale.builtin.commandmacro;

import javax.annotation.Nullable;

public class MacroCommandReplacement {
   private final String nameOfReplacingArg;
   @Nullable
   private final String optionalArgumentKey;
   private final String stringToReplaceWithValue;

   public MacroCommandReplacement(String nameOfReplacingArg, String stringToReplaceWithValue, @Nullable String optionalArgumentKey) {
      this.nameOfReplacingArg = nameOfReplacingArg;
      this.stringToReplaceWithValue = stringToReplaceWithValue;
      this.optionalArgumentKey = optionalArgumentKey == null ? null : "--" + optionalArgumentKey + (optionalArgumentKey.endsWith("=") ? "" : " ");
   }

   public MacroCommandReplacement(String replacementKey, String stringToReplaceWithValue) {
      this(replacementKey, stringToReplaceWithValue, null);
   }

   public String getNameOfReplacingArg() {
      return this.nameOfReplacingArg;
   }

   @Nullable
   public String getOptionalArgumentKey() {
      return this.optionalArgumentKey;
   }

   public String getStringToReplaceWithValue() {
      return this.stringToReplaceWithValue;
   }
}