public enum ClassRelationType extends Enum<ClassRelationType>
Class relation types.
Use of(Class, Class) method to determine ClassRelationType of two Classes.
Use of(Object, Object) method to determine ClassRelationType of two Objects.| Enum Constant and Description |
|---|
ANCESTOR
One class is an ancestor of onother one.
|
DESCENDANT
One class is a descendant of onother one.
|
SAME
Classes are the same.
|
UNRELATED
Classes are not related.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isAncestor()
Returns whether or not one class is an ancestor of onother one.
|
boolean |
isDescendant()
Returns whether or not one class is a descendant of onother one.
|
boolean |
isRelated()
Returns whether or not classes are related.
|
boolean |
isSame()
Returns whether or not classes are the same.
|
boolean |
isUnrelated()
Returns whether or not classes are not related.
|
static ClassRelationType |
of(Class one,
Class another)
Returns one class relation to another one.
|
static ClassRelationType |
of(Object one,
Object another)
Returns one object class relation to another one.
|
static ClassRelationType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ClassRelationType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ClassRelationType SAME
public static final ClassRelationType ANCESTOR
public static final ClassRelationType DESCENDANT
public static final ClassRelationType UNRELATED
public static ClassRelationType[] values()
for (ClassRelationType c : ClassRelationType.values()) System.out.println(c);
public static ClassRelationType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic boolean isSame()
true if classes are the same, false otherwisepublic boolean isAncestor()
true if one class is an ancestor of onother one, false otherwisepublic boolean isDescendant()
true if one class is a descendant of onother one, false otherwisepublic boolean isUnrelated()
true if classes are not related, false otherwisepublic boolean isRelated()
true if classes are related, false otherwisepublic static ClassRelationType of(Object one, Object another)
one - some objectanother - another objectpublic static ClassRelationType of(Class one, Class another)
one - some classanother - another classCopyright © 2020. All rights reserved.