public class DomainUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static org.eclipse.ocl.examples.domain.utilities.DomainUtil.NameableComparator |
NAMEABLE_COMPARATOR |
| Constructor and Description |
|---|
DomainUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
bind(java.lang.String messageTemplate,
java.lang.Object... bindings) |
static java.lang.String |
convertFromOCLString(java.lang.String javaString)
Mostly copied from
Properties.loadConvert(char[], int, int, char[]) via
Strings.convertFromJavaString(java.lang.String, boolean) |
static java.lang.String |
convertToOCLString(java.lang.String theString)
Mostly copied from
Properties.saveConvert(java.lang.String, boolean, boolean) via
Strings.convertToJavaString(java.lang.String) |
static java.lang.Number |
createNumberFromString(java.lang.String aValue) |
static java.lang.String |
debugEventType(int eventType) |
static java.lang.String |
debugFullName(java.lang.Object object) |
static java.lang.String |
debugSimpleName(java.lang.Object object) |
static void |
formatMultiplicity(java.lang.StringBuilder s,
long lower,
long upper)
Append a multiplicity string such as "[1..5]" to a StringBuilder.
|
static java.lang.String |
getLabel(org.eclipse.emf.ecore.EClassifier eClassifier,
java.lang.Object object,
java.util.Map<java.lang.Object,java.lang.Object> context)
Return a simple readable description of object.
|
static java.lang.String |
getLabel(org.eclipse.emf.ecore.EObject eObject)
Return a simple readable description of eObject using an IItemLabelProvider if possible.
|
static DomainType[] |
getLambdaParameterTypes(DomainLambdaType lambdaType) |
static <T extends DomainNamedElement> |
getNamedElement(java.lang.Iterable<T> elements,
java.lang.String name) |
static DomainType[] |
getOperationParameterTypes(DomainOperation anOperation) |
static java.lang.String |
getSafeName(Nameable aNameable) |
static <T> T |
nonNullEMF(T aT)
Return aT, checking the assertion that this call would not be necessary if EMF had comprehensive @NonNull annotations.
|
static <T> T |
nonNullModel(T aT)
Check for an in appropriate model state which should have been detected by a model validation pass.
|
static <T> T |
nonNullPivot(T aT)
Return aT, checking the assertion that this call would not be necessary if the Pivot model was guaranteed to be valid.
|
static <T> T |
nonNullState(T aT)
Check for an in appropriate program state.
|
static void |
suppressThrowWarnings()
Deprecated.
|
static char |
toHex(int nibble)
Copied from
Properties |
public static final org.eclipse.ocl.examples.domain.utilities.DomainUtil.NameableComparator NAMEABLE_COMPARATOR
@NonNull
public static java.lang.String bind(java.lang.String messageTemplate,
java.lang.Object... bindings)
@NonNull
public static java.lang.String convertFromOCLString(@NonNull
java.lang.String javaString)
Properties.loadConvert(char[], int, int, char[]) via
Strings.convertFromJavaString(java.lang.String, boolean)public static java.lang.String convertToOCLString(java.lang.String theString)
Properties.saveConvert(java.lang.String, boolean, boolean) via
Strings.convertToJavaString(java.lang.String)@NonNull
public static java.lang.Number createNumberFromString(@NonNull
java.lang.String aValue)
throws java.lang.NumberFormatException
java.lang.NumberFormatExceptionpublic static java.lang.String debugEventType(int eventType)
public static java.lang.String debugFullName(java.lang.Object object)
public static java.lang.String debugSimpleName(java.lang.Object object)
public static void formatMultiplicity(@NonNull
java.lang.StringBuilder s,
long lower,
long upper)
public static java.lang.String getLabel(org.eclipse.emf.ecore.EObject eObject)
public static java.lang.String getLabel(org.eclipse.emf.ecore.EClassifier eClassifier,
java.lang.Object object,
java.util.Map<java.lang.Object,java.lang.Object> context)
@NonNull public static DomainType[] getLambdaParameterTypes(@NonNull DomainLambdaType lambdaType)
public static <T extends DomainNamedElement> T getNamedElement(java.lang.Iterable<T> elements, java.lang.String name)
@NonNull public static DomainType[] getOperationParameterTypes(@NonNull DomainOperation anOperation)
@NonNull
public static java.lang.String getSafeName(@Nullable
Nameable aNameable)
@NonNull
public static <T> T nonNullEMF(@Nullable
T aT)
@NonNull
public static <T> T nonNullModel(@Nullable
T aT)
Return aT, checking the assertion that this call would not be necessary if the Ecore model was guaranteed to be valid.
@NonNull
public static <T> T nonNullPivot(@Nullable
T aT)
@NonNull
public static <T> T nonNullState(@Nullable
T aT)
If the inappropriate state really cannot happen, an assertion should be used instead to avoid non-debug run-time cost.
Return aT, throwing an IllegalStateException if null.
@Deprecated public static void suppressThrowWarnings()
InvalidValueExceptionpublic static char toHex(int nibble)
Properties