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

com.enonic.xp.util.BinaryReferences Maven / Gradle / Ivy

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

import java.util.stream.Stream;

import com.google.common.collect.ImmutableSet;

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

@PublicApi
public class BinaryReferences
    extends AbstractImmutableEntitySet
{
    private BinaryReferences( final ImmutableSet set )
    {
        super( set );
    }

    public static BinaryReferences empty()
    {
        return new BinaryReferences( ImmutableSet.of() );
    }

    public static BinaryReferences from( final String... binaryReferences )
    {
        return new BinaryReferences( Stream.of( binaryReferences ).map( BinaryReference::from ).collect( ImmutableSet.toImmutableSet() ) );
    }

    public static BinaryReferences from( final BinaryReference... binaryReferences )
    {
        return new BinaryReferences( ImmutableSet.copyOf( binaryReferences ) );
    }

    public static BinaryReferences from( final Iterable binaryReferences )
    {
        return new BinaryReferences( ImmutableSet.copyOf( binaryReferences ) );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy