Example usage for com.google.common.collect ImmutableSet toArray

List of usage examples for com.google.common.collect ImmutableSet toArray

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableSet toArray.

Prototype

<T> T[] toArray(T[] a);

Source Link

Document

Returns an array containing all of the elements in this set; the runtime type of the returned array is that of the specified array.

Usage

From source file:org.fcrepo.transform.sparql.JQLQueryVisitor.java

/**
 * Get the columns for the JCR query//from  w ww .  jav a  2  s .c  om
 * @return
 */
private Column[] getColumns() {
    final ImmutableSet<Column> build = this.columns.build();
    return build.toArray(new Column[build.size()]);
}

From source file:com.facebook.buck.io.filesystem.impl.FakeProjectFilesystem.java

@Override
public void copy(Path source, Path target, CopySourceMode sourceMode) {
    Path normalizedSourcePath = MorePaths.normalize(source);
    Path normalizedTargetPath = MorePaths.normalize(target);
    switch (sourceMode) {
    case FILE://  w  w w.  j  a v  a 2 s  .  co m
        ImmutableSet<FileAttribute<?>> attrs = fileAttributes.get(normalizedSourcePath);
        writeBytesToPath(fileContents.get(normalizedSourcePath), normalizedTargetPath,
                attrs.toArray(new FileAttribute[0]));
        break;
    case DIRECTORY_CONTENTS_ONLY:
    case DIRECTORY_AND_CONTENTS:
        throw new UnsupportedOperationException();
    }
}