Class 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.
    • 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 appropriate fields.
        Parameters:
        key - The String value to be stored as the name of the parameter
        value - 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.
        Overrides:
        toString in class Object
        Returns:
        The String representation of a DSpaceCommandlineParameter object
      • 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 parameter is equal to this object.
        Overrides:
        equals in class Object
        Parameters:
        other - The other object
        Returns:
        A boolean indicating equality
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object