Search in sources :

Example 1 with SerializableEObjectDescriptionProvider

use of org.eclipse.xtext.resource.persistence.SerializableEObjectDescriptionProvider in project xtext-core by eclipse.

the class SerializableResourceDescription method createCopy.

private static SerializableEObjectDescription createCopy(final IEObjectDescription desc) {
    if ((desc instanceof SerializableEObjectDescriptionProvider)) {
        return ((SerializableEObjectDescriptionProvider) desc).toSerializableEObjectDescription();
    }
    SerializableEObjectDescription _serializableEObjectDescription = new SerializableEObjectDescription();
    final Procedure1<SerializableEObjectDescription> _function = (SerializableEObjectDescription it) -> {
        it.setEClass(desc.getEClass());
        it.setEObjectURI(desc.getEObjectURI());
        it.qualifiedName = desc.getQualifiedName();
        int _size = ((List<String>) Conversions.doWrapArray(desc.getUserDataKeys())).size();
        HashMap<String, String> _hashMap = new HashMap<String, String>(_size);
        it.userData = _hashMap;
        String[] _userDataKeys = desc.getUserDataKeys();
        for (final String key : _userDataKeys) {
            it.userData.put(key, desc.getUserData(key));
        }
    };
    return ObjectExtensions.<SerializableEObjectDescription>operator_doubleArrow(_serializableEObjectDescription, _function);
}
Also used : SerializableEObjectDescription(org.eclipse.xtext.resource.persistence.SerializableEObjectDescription) HashMap(java.util.HashMap) SerializableEObjectDescriptionProvider(org.eclipse.xtext.resource.persistence.SerializableEObjectDescriptionProvider)

Aggregations

HashMap (java.util.HashMap)1 SerializableEObjectDescription (org.eclipse.xtext.resource.persistence.SerializableEObjectDescription)1 SerializableEObjectDescriptionProvider (org.eclipse.xtext.resource.persistence.SerializableEObjectDescriptionProvider)1