Skip to content

Commit

Permalink
Add Labeled interface (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksclarke committed Jun 25, 2023
1 parent d1c68e8 commit d6f6be1
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 69 deletions.
99 changes: 30 additions & 69 deletions src/main/java/info/freelibrary/util/Constants.java
Expand Up @@ -6,125 +6,86 @@
*/
public final class Constants {

/**
* A constant for a message slot.
*/
/** A constant for a message slot. */
public static final String MESSAGE_SLOT = "{}";

/**
* The default / any host IP address.
*/
/** The default / any host IP address. */
public static final String INADDR_ANY = "0.0.0.0"; // NOPMD - don't hard code IPs

/**
* A constant for an end of line character.
*/
/** A constant for an end of line character. */
public static final String EOL = System.lineSeparator();

/**
* A constant for an empty string.
*/
/** A constant for an empty string. */
public static final String EMPTY = "";

/**
* A constant for a space character.
*/
/** A constant for a space character. */
public static final String SPACE = " ";

/**
* A constant for a colon.
*/
/** A constant for a colon. */
public static final String COLON = ":";

/**
* A constant for a slash.
*/
/** A constant for a slash. */
public static final String SLASH = "/";

/**
* A constant for a hash.
*/
/** A constant for a hash. */
public static final String HASH = "#";

/**
* A constant for a dash.
*/
/** A constant for a dash. */
public static final String DASH = "-";

/**
* A constant for a comma.
*/
/** A constant for a comma. */
public static final String COMMA = ",";

/**
* A constant for a period.
*/
/** A constant for a period. */
public static final String PERIOD = ".";

/**
* A constant for a vertical bar.
*/
/** A constant for a vertical bar. */
public static final String VERTICAL_BAR = "|";

/**
* A constant for the plus symbol.
*/
/** A constant for the plus symbol. */
public static final String PLUS = "+";

/**
* A constant for the equals sign.
*/
/** A constant for the equals sign. */
public static final String EQUALS = "=";

/**
* A constant for a question mark.
*/
/** A constant for a question mark. */
public static final String QUESTION_MARK = "?";

/**
* A constant for a single instance.
*/
/** A constant for a quote. */
public static final String QUOTE = "\"";

/** A constant for a single instance. */
public static final int SINGLE_INSTANCE = 1;

/**
* A constant for a zero character.
*/
/** A constant for a zero character. */
public static final char ZERO_CHAR = '0';

/**
* A constant for a dash character.
*/
/** A constant for a dash character. */
public static final char DASH_CHAR = '-';

/**
* A constant for a plus character.
*/
/** A constant for a plus character. */
public static final char PLUS_CHAR = '+';

/**
* A constant for a dot character.
*/
/** A constant for a dot character. */
public static final char DOT_CHAR = '.';

/**
* A constant for the string representation of Boolean.TRUE.
*/
/** A constant for the string representation of Boolean.TRUE. */
public static final String TRUE = "true";

/**
* A constant for the string representation of Boolean.FALSE.
*/
/** A constant for the string representation of Boolean.FALSE. */
public static final String FALSE = "false";

/**
* A constant for the string representation of null.
*/
/** A constant for the string representation of null. */
public static final String NULL = "null";

/** A constant for an underscore string. */
public static final String UNDERSCORE = "_";

/**
* Private constructor for a constants class.
*/
private Constants() {
// This is intentionally left empty.
}

}
15 changes: 15 additions & 0 deletions src/main/java/info/freelibrary/util/Labeled.java
@@ -0,0 +1,15 @@

package info.freelibrary.util;

/**
* An interface for enumerations that standardizes accessing the enum's label.
*/
public interface Labeled {

/**
* Gets the enumeration's label.
*
* @return A label
*/
String label();
}

0 comments on commit d6f6be1

Please sign in to comment.