All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ceylon.language.impl.MemberImpl.ceylon Maven / Gradle / Ivy

There is a newer version: 1.3.3
Show newest version
import ceylon.language.meta.declaration {
    ValueDeclaration, FunctionOrValueDeclaration
}
import ceylon.language.serialization {
    Member, UninitializedLateValue
}

"Implementation of [[Member]], in ceylon.language.impl because although 
 compiled user classes depend on it, it is not part of the public API."
shared class MemberImpl satisfies Member {
    shared actual ValueDeclaration attribute;
    
    shared new (FunctionOrValueDeclaration attribute) {
        assert(is ValueDeclaration attribute);
        this.attribute = attribute;
    }
    
    shared actual Anything|UninitializedLateValue referred(Object/**/ instance) {
        return reach.getAnything(instance, this);
    }
    
    shared actual String string
            => "Member [attribute=``attribute``]";
    
    shared actual Integer hash => attribute.hash;
    shared actual Boolean equals(Object other) {
        if (is MemberImpl other) {
            return this === other || attribute == other.attribute;
        } else {
            return false;
        }
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy