Package org.dspace.scripts
Class DSpaceCommandLineParameter
- java.lang.Object
-
- org.dspace.scripts.DSpaceCommandLineParameter
-
public class DSpaceCommandLineParameter extends Object
This class serves as a representation of a command line parameter by holding a String name and a String value
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDSpaceCommandLineParameter(String parameter)This constructors accepts a single parameter String that is defined as e.g.DSpaceCommandLineParameter(String key, String value)This constructor will take a String key and String value and store them in their appriopriate fields
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Stringconcatenate(List<DSpaceCommandLineParameter> parameterList)This method will convert a list of DSpaceCommandLineParameter objects into a single String.booleanequals(Object other)Will return a boolean indicating whether the given param is equal to this objectStringgetName()StringgetValue()inthashCode()voidsetName(String key)voidsetValue(String value)StringtoString()Converts the DSpaceCommandLineParameter into a String format by concatenating the value and the name String values by separating them with a space
-
-
-
Field Detail
-
SEPARATOR
public static String SEPARATOR
-
-
Constructor Detail
-
DSpaceCommandLineParameter
public DSpaceCommandLineParameter(String key, String value)
This constructor will take a String key and String value and store them in their appriopriate fields- Parameters:
key- The String value to be stored as the name of the parametervalue- The String value to be stored as the value of the parameter
-
DSpaceCommandLineParameter
protected DSpaceCommandLineParameter(String parameter)
This constructors accepts a single parameter String that is defined as e.g. "-c test" and it'll parse this String into the key "-c" and value "test" to then call the other constructor with those parameters- Parameters:
parameter- The String parameter
-
-
Method Detail
-
getName
public String getName()
-
setName
public void setName(String key)
-
getValue
public String getValue()
-
setValue
public void setValue(String value)
-
toString
public String toString()
Converts the DSpaceCommandLineParameter into a String format by concatenating the value and the name String values by separating them with a space
-
concatenate
public static String concatenate(List<DSpaceCommandLineParameter> parameterList)
This method will convert a list of DSpaceCommandLineParameter objects into a single String. This is done by calling the toString() method on each of the DSpaceCommandLineParameter objects in the list and concatenating them with the Separator defined in this class- Parameters:
parameterList- The list of DSpaceCommandLineParameter objects to be converted into a String- Returns:
- The resulting String
-
equals
public boolean equals(Object other)
Will return a boolean indicating whether the given param is equal to this object
-
-