# Services available for all types

### add(self: java.lang.Object, s: java.lang.String) = String

Returns the concatenation of self (as a String) and the given string "s".

Expression | Result
--- | ---
42 + ' times' | '42 times'

### add(self: java.lang.String, any: java.lang.Object) = String

Returns the concatenation of the current string and the given object "any" (as a String).

Expression | Result
--- | ---
'times ' + 42 | 'times 42'

### differs(o1: java.lang.Object, o2: java.lang.Object) = Boolean

Indicates whether the object "o1" is a different object from the object "o2".

Expression | Result
--- | ---
'Hello' <> 'World' | true
'Hello' <> 'Hello' | false

### equals(o1: java.lang.Object, o2: java.lang.Object) = Boolean

Indicates whether the object "o1" is the same as the object "o2". For more information refer to the Object#equals(Object) method.

Expression | Result
--- | ---
'Hello' = 'World' | false
'Hello' = 'Hello' | true

### oclAsType(object: java.lang.Object, type: java.lang.Object) = Object

Casts the current object to the given type.

Expression | Result
--- | ---
anEPackage.oclAsType(ecore::EPackage) | anEPackage
anEPackage.oclAsType(ecore::EClass) | anEPackage

Contrary to Acceleo 3, the type is ignored, the given object will be returned directly.

#### In other languages

Language | Expression | Result
--- | --- | ---
Acceleo 3 (MTL) | anEPackage.oclAsType(ecore::EPackage) | anEPackage
Acceleo 3 (MTL) | anEPackage.oclAsType(ecore::EClass) | oclInvalid

### oclIsKindOf(object: java.lang.Object, type: java.lang.Object) = Boolean

Evaluates to "true" if the type of the object o1 conforms to the type "classifier". That is, o1 is of type "classifier" or a subtype of "classifier".

Expression | Result
--- | ---
anEPackage.oclIsKindOf(ecore::EPackage) | true
anEPackage.oclIsKindOf(ecore::ENamedElement) | true

### oclIsTypeOf(object: java.lang.Object, type: java.lang.Object) = Boolean

Evaluates to "true" if the object o1 if of the type "classifier" but not a subtype of the "classifier".

Expression | Result
--- | ---
anEPackage.oclIsTypeOf(ecore::EPackage) | true
anEPackage.oclIsTypeOf(ecore::ENamedElement) | false

### toString(self: java.lang.Object) = String

Returns a string representation of the current object.

Expression | Result
--- | ---
42.toString() | '42'

### trace(self: java.lang.Object) = String

Returns a string representation of the current environment.

Expression | Result
--- | ---
42.trace() | 'Metamodels: http://www.eclipse.org/emf/2002/Ecore Services: org.eclipse.acceleo.query.services.AnyServices public java.lang.String org.eclipse.acceleo.query.services.AnyServices.add(java.lang.Object,java.lang.String) ... receiver: 42 '