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

com.enonic.xp.schema.mixin.MixinName Maven / Gradle / Ivy

There is a newer version: 7.14.4
Show newest version
package com.enonic.xp.schema.mixin;

import com.enonic.xp.annotation.PublicApi;
import com.enonic.xp.app.ApplicationKey;
import com.enonic.xp.schema.BaseSchemaName;

@PublicApi
public final class MixinName
    extends BaseSchemaName
    implements Comparable
{
    private MixinName( final String name )
    {
        super( name );
    }

    private MixinName( final ApplicationKey applicationKey, final String localName )
    {
        super( applicationKey, localName );
    }

    public static MixinName from( final ApplicationKey applicationKey, final String localName )
    {
        return new MixinName( applicationKey, localName );
    }

    public static MixinName from( final String mixinName )
    {
        return new MixinName( mixinName );
    }

    public String getApplicationPrefix() {
        return this.getApplicationKey() == null ? "" : this.getApplicationKey().toString().replace( '.', '-' );
    }

    @Override
    public int compareTo( final MixinName that )
    {
        return this.toString().compareTo( that.toString() );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy