|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rythmengine.toString.ToStringOption
public class ToStringOption
Defines the options can be set when output an object into string
| Field Summary | |
|---|---|
boolean |
appendStatic
Whether output static fields |
boolean |
appendTransient
Whether output transient fields |
static ToStringOption |
DEFAULT_OPTION
The default option instance, with upToClassset to null, meaning up to Object root
appendTransient set to false, will not output transient fields
appendStatic set to false, will not output static fields
|
Class<?> |
upToClass
Specify the up most parent class whose declared fields will be output. |
| Constructor Summary | |
|---|---|
ToStringOption()
Construct an new default option |
|
ToStringOption(boolean appendStatic,
boolean appendTransient)
Construct an option with specified appendStatic and appendTransient switch. |
|
ToStringOption(boolean appendStatic,
boolean appendTransient,
Class<?> upToClass)
Construct an option with static, transient output switch and upToClass |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
int |
hashCode()
|
ToStringOption |
setAppendStatic(boolean appendStatic)
Return a ToStringOption instance with appendStatic option set. |
ToStringOption |
setAppendTransient(boolean appendTransient)
Return a ToStringOption instance with appendTransient option set. |
ToStringOption |
setUpToClass(Class<?> c)
Return a ToStringOption instance with upToClass option set. |
String |
toString()
Print this to string option instance using the following logic: |
static ToStringOption |
valueOf(String s)
Construct a ToStringOption instance out from a string. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final ToStringOption DEFAULT_OPTION
upToClassset to null, meaning up to Object rootappendTransient set to false, will not output transient fieldsappendStatic set to false, will not output static fields
public Class<?> upToClass
null, meaning all parent class declared
fields will be output
public boolean appendTransient
public boolean appendStatic
| Constructor Detail |
|---|
public ToStringOption()
DEFAULT_OPTION
public ToStringOption(boolean appendStatic,
boolean appendTransient)
appendStatic - when set to true the static fields will be outputappendTransient - when set to true the transient fields will be output
public ToStringOption(boolean appendStatic,
boolean appendTransient,
Class<?> upToClass)
appendStatic - when set to true the static fields will be outputappendTransient - when set to true the trasient fields will be outputupToClass - when set then the fields up to this parent class will be output,
otherwise it will be up to Object root| Method Detail |
|---|
public ToStringOption setAppendTransient(boolean appendTransient)
ToStringOption instance with appendTransient option set.
if the current instance is not default instance then set
on the current instance and return the current instance. Otherwise, clone the default
instance and set on the clone and return the clone
appendTransient -
DEFAULT_OPTIONpublic ToStringOption setAppendStatic(boolean appendStatic)
ToStringOption instance with appendStatic option set.
if the current instance is not default instance then set
on the current instance and return the current instance. Otherwise, clone the default
instance and set on the clone and return the clone
appendStatic -
DEFAULT_OPTIONpublic ToStringOption setUpToClass(Class<?> c)
ToStringOption instance with upToClass option set.
if the current instance is not default instance then set
on the current instance and return the current instance. Otherwise, clone the default
instance and set on the clone and return the clone
c -
DEFAULT_OPTIONpublic String toString()
return Rythm.toString(
"{appendStatic: @_.appendStatic; " +
"appendTransient: @_.appendTransient; " +
upToClass: @_.upToClass?.getName()}", this);
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic static ToStringOption valueOf(String s)
ToStringOption instance out from a string. The format
of the String should be the same as the format output of toString()
method
s -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||