Package net.sf.basedb.core.log
Enum ChangeType
- java.lang.Object
-
- java.lang.Enum<ChangeType>
-
- net.sf.basedb.core.log.ChangeType
-
- All Implemented Interfaces:
Serializable
,Comparable<ChangeType>
public enum ChangeType extends Enum<ChangeType>
Enumeration that represents the type of change that has happened. Note! BASE 3.9 added some new change types not actually related to change.- Version:
- 2.13
- Author:
- Nicklas
- Last modified
- $Date: 2016-06-03 10:01:23 +0200 (fr, 03 jun 2016) $
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ChangeType(int value, String was)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ChangeType
fromValue(int value)
Get the change type corresponding to the given numerical value.int
getValue()
Get the numerical value for this change type.static ChangeType
valueOf(String name)
Returns the enum constant of this type with the specified name.static ChangeType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.String
was(String what)
Create a string for display purposes that explains what has happened to the what.
-
-
-
Enum Constant Detail
-
CREATE
public static final ChangeType CREATE
-
UPDATE
public static final ChangeType UPDATE
-
DELETE
public static final ChangeType DELETE
-
ADD
public static final ChangeType ADD
-
REMOVE
public static final ChangeType REMOVE
-
VIEW
public static final ChangeType VIEW
- Since:
- 3.9
-
DOWNLOAD
public static final ChangeType DOWNLOAD
- Since:
- 3.9
-
-
Field Detail
-
value
private final int value
-
was
private final String was
-
-
Constructor Detail
-
ChangeType
private ChangeType(int value, String was)
-
-
Method Detail
-
values
public static ChangeType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ChangeType c : ChangeType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ChangeType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getValue
public int getValue()
Get the numerical value for this change type. Each change type has a unique value.
-
was
public String was(String what)
Create a string for display purposes that explains what has happened to the what. For example, if what is 'Annotation', this method may return 'Annotation created'.- Parameters:
what
- The 'what' that something happened to- Returns:
- A string
-
fromValue
public static ChangeType fromValue(int value)
Get the change type corresponding to the given numerical value.- Parameters:
value
- The numerical value- Returns:
- The change type, or null if there is no change type with the same valye
-
-