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

com.enonic.xp.region.PartDescriptors Maven / Gradle / Ivy

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

import java.util.Collection;

import com.google.common.collect.ImmutableList;

import com.enonic.xp.annotation.PublicApi;
import com.enonic.xp.support.AbstractImmutableEntityList;

@PublicApi
public final class PartDescriptors
    extends AbstractImmutableEntityList
{
    private PartDescriptors( final ImmutableList list )
    {
        super( list );
    }

    public static PartDescriptors empty()
    {
        return new PartDescriptors( ImmutableList.of() );
    }

    public static PartDescriptors from( final PartDescriptor... descriptors )
    {
        return descriptors != null ? new PartDescriptors( ImmutableList.copyOf( descriptors ) ) : PartDescriptors.empty();
    }

    public static PartDescriptors from( final Iterable descriptors )
    {
        return descriptors != null ? new PartDescriptors( ImmutableList.copyOf( descriptors ) ) : PartDescriptors.empty();
    }

    public static PartDescriptors from( final Collection descriptors )
    {
        return descriptors != null ? new PartDescriptors( ImmutableList.copyOf( descriptors ) ) : PartDescriptors.empty();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy