| 构造器和说明 |
|---|
EnumBuster(Class<E> clazz,
Class... switchUsers)
Construct an EnumBuster for the given enum class and keep
the switch statements of the classes specified in
switchUsers in sync with the enum values.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addByValue(E e)
This method adds the given enum into the array
inside the enum class.
|
boolean |
deleteByValue(E e)
We delete the enum from the values array and set the
constant pointer to null.
|
E |
make(String value)
Make a new enum instance, without adding it to the values
array and using the default ordinal of 0.
|
E |
make(String value,
int ordinal)
Make a new enum instance with the given ordinal.
|
E |
make(String value,
int ordinal,
Class[] additionalTypes,
Object[] additional)
Make a new enum instance with the given value, ordinal and
additional parameters.
|
void |
registerSwitchClass(Class[] switchUsers) |
void |
restore()
Undo the state right back to the beginning when the
EnumBuster was created.
|
boolean |
undo()
Undo the previous operation.
|
public E make(String value)
public E make(String value, int ordinal, Class[] additionalTypes, Object[] additional)
public void addByValue(E e)
e - the enum to addpublic boolean deleteByValue(E e)
e - the enum to delete from the type.public void restore()
public boolean undo()
public void registerSwitchClass(Class[] switchUsers)
Copyright © 2014–2018 码农场. All rights reserved.