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

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

The 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 LayoutDescriptors
    extends AbstractImmutableEntityList
{
    private LayoutDescriptors( final ImmutableList list )
    {
        super( list );
    }

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy