@Immutable @ParametersAreNonnullByDefault public class ClassBean extends Object implements Serializable
EClass
.Modifier | Constructor and Description |
---|---|
protected |
ClassBean(String name,
String uri)
Constructs a new
ClassBean with the given name and uri , which are used as a simple
representation of a an EClass . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static ClassBean |
from(org.eclipse.emf.ecore.EClass eClass)
Creates a new
ClassBean from the given reference . |
static ClassBean |
from(PersistentEObject object)
Creates a new
ClassBean from the given object . |
org.eclipse.emf.ecore.EClass |
get()
Retrieves the
EClass corresponding to this ClassBean . |
int |
hashCode() |
Set<ClassBean> |
inheritedBy()
Retrieves all subclasses of this
ClassBean . |
Optional<ClassBean> |
inheritFrom()
Retrieves the superclass of this
ClassBean . |
boolean |
isAbstract()
Returns whether this
ClassBean represents an abstract class. |
boolean |
isInterface()
Returns whether this
ClassBean represents an interface. |
String |
name()
Returns the name of this
ClassBean . |
static ClassBean |
of(String name,
String uri)
Creates a new
ClassBean with the given name and uri , which are used as a simple
representation of a an EClass . |
String |
toString() |
String |
uri()
Returns the literal representation of the
URI of this ClassBean . |
@Nonnull public static ClassBean from(PersistentEObject object)
ClassBean
from the given object
. The EClass
will be
found by calling the EObject.eClass()
method.
This method behaves like: of(reference.getName(), reference.getEPackage().getNsURI())
.
object
- the object from which the EClass
has to be retrieve with the EObject.eClass()
methodClassBean
NullPointerException
- if any argument is null
from(EClass)
@Nonnull public static ClassBean from(org.eclipse.emf.ecore.EClass eClass)
ClassBean
from the given reference
.
This method behaves like: of(reference.getName(), reference.getEPackage().getNsURI())
.
eClass
- the EClass
ClassBean
NullPointerException
- if any argument is null
@Nonnull public static ClassBean of(String name, String uri)
ClassBean
with the given name
and uri
, which are used as a simple
representation of a an EClass
.name
- the name of the EClass
uri
- the literal representation of the URI
of the EClass
ClassBean
NullPointerException
- if any argument is null
@Nonnull public String uri()
URI
of this ClassBean
.public boolean isAbstract()
ClassBean
represents an abstract class.true
if this ClassBean
represents an abstract class, false
otherwisepublic boolean isInterface()
ClassBean
represents an interface.true
if this ClassBean
represents an interface, false
otherwise@Nonnull public Optional<ClassBean> inheritFrom()
ClassBean
.Optional
containing the representation of the direct superclass, or Optional.empty()
if the class has no superclass@Nonnull public Set<ClassBean> inheritedBy()
ClassBean
.Set
containing the representation of all non-abstract subclasses that inherit,
directly and indirectly, from this ClassBean
@Nonnull public org.eclipse.emf.ecore.EClass get()
EClass
corresponding to this ClassBean
.null
if it cannot be foundCopyright © 2013–2019 Atlanmod. All rights reserved.