com.enonic.xp.util.BinaryReferences Maven / Gradle / Ivy
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 ) );
}
}