Example usage for com.google.common.collect ImmutableMap of

List of usage examples for com.google.common.collect ImmutableMap of

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableMap of.

Prototype

public static <K, V> ImmutableMap<K, V> of() 

Source Link

Usage

From source file:keywhiz.api.model.SanitizedSecret.java

@JsonCreator
public static SanitizedSecret of(@JsonProperty("id") long id, @JsonProperty("name") String name,
        @JsonProperty("description") @Nullable String description, @JsonProperty("checksum") String checksum,
        @JsonProperty("createdAt") ApiDate createdAt, @JsonProperty("createdBy") @Nullable String createdBy,
        @JsonProperty("updatedAt") ApiDate updatedAt, @JsonProperty("updatedBy") @Nullable String updatedBy,
        @JsonProperty("metadata") @Nullable Map<String, String> metadata,
        @JsonProperty("type") @Nullable String type,
        @JsonProperty("generationOptions") @Nullable Map<String, String> generationOptions,
        @JsonProperty("expiry") long expiry, @JsonProperty("version") @Nullable Long version) {
    ImmutableMap<String, String> meta = (metadata == null) ? ImmutableMap.of() : ImmutableMap.copyOf(metadata);
    ImmutableMap<String, String> genOptions = (generationOptions == null) ? ImmutableMap.of()
            : ImmutableMap.copyOf(generationOptions);
    return new AutoValue_SanitizedSecret(id, name, nullToEmpty(description), checksum, createdAt,
            nullToEmpty(createdBy), updatedAt, nullToEmpty(updatedBy), meta, Optional.ofNullable(type),
            genOptions, expiry, Optional.ofNullable(version));
}

From source file:org.opendaylight.controller.cluster.datastore.StandaloneFrontendHistory.java

static StandaloneFrontendHistory create(final String persistenceId, final ClientIdentifier clientId,
        final ShardDataTree tree) {
    return new StandaloneFrontendHistory(persistenceId, clientId, tree, ImmutableMap.of(),
            TreeRangeSet.create());/*from   w w w.j  a va  2s  . c  o  m*/
}

From source file:com.google.idea.blaze.base.filecache.FileDiffer.java

public static <K, V> void diffState(@Nullable Map<K, V> oldState, Map<K, V> newState, List<K> updated,
        List<K> removed) {/*from  w ww. j  a  v  a2 s .  c o  m*/
    oldState = oldState != null ? oldState : ImmutableMap.of();

    // Find changed/new
    for (Map.Entry<K, V> entry : newState.entrySet()) {
        K key = entry.getKey();
        V value = entry.getValue();
        V oldValue = oldState.get(key);

        final boolean isUpdated = oldValue == null || !value.equals(oldValue);
        if (isUpdated) {
            updated.add(key);
        }
    }

    // Find removed
    Set<K> removedSet = Sets.newHashSet();
    removedSet.addAll(oldState.keySet());
    removedSet.removeAll(newState.keySet());
    removed.addAll(removedSet);
}

From source file:com.spectralogic.ds3cli.metadata.NullFileMetadata.java

@Override
public ImmutableMap<String, String> readMetadataFrom(final Path filePath) throws IOException {
    return ImmutableMap.of();
}

From source file:com.opengamma.strata.pricer.calibration.RatesProviderGenerator.java

/**
 * Generates a rates provider from a set of parameters.
 * <p>/*ww w. j a  v a  2 s.  c o m*/
 * The number of parameters passed has to match the total number of parameters in all the curves generated.
 * 
 * @param parameters  the parameters describing the provider
 * @return the provider
 */
public default ImmutableRatesProvider generate(DoubleArray parameters) {
    return generate(parameters, ImmutableMap.of());
}

From source file:com.flaptor.indextank.index.scorer.NoFacetingManager.java

@Override
public Faceter createFaceter() {
    return new Faceter() {
        @Override/*from ww w .  j a  v  a2  s .c  o  m*/
        public Map<String, Multiset<String>> getFacets() {
            return ImmutableMap.of();
        }

        @Override
        public void computeDocument(DocId documentId) {
        }
    };
}

From source file:com.spectralogic.ds3autogen.converters.UpdateElementsConverter.java

/**
 * Updates all Ds3Type's Ds3Elements to properly denote nullability or exclusion
 *///from  www.  j  a  v a2  s.  c  o  m
protected static ImmutableMap<String, Ds3Type> updateElementsInTypeMap(
        final ImmutableMap<String, Ds3Type> typeMap) {
    if (isEmpty(typeMap)) {
        return ImmutableMap.of();
    }
    final ImmutableMap.Builder<String, Ds3Type> builder = ImmutableMap.builder();
    for (final Map.Entry<String, Ds3Type> entry : typeMap.entrySet()) {
        builder.put(entry.getKey(), updateElementsInType(entry.getValue()));
    }
    return builder.build();
}

From source file:com.google.firebase.auth.hash.Bcrypt.java

@Override
protected Map<String, Object> getOptions() {
    return ImmutableMap.of();
}

From source file:net.derquinse.common.collect.EmptyImmutableHierarchyMap.java

@Override
protected Map<Object, Object> delegate() {
    return ImmutableMap.of();
}

From source file:org.apache.druid.server.initialization.jetty.TaskIdResponseHeaderFilterHolder.java

public TaskIdResponseHeaderFilterHolder(String path, String taskId) {
    super(path,
            taskId == null ? ImmutableMap.of() : ImmutableMap.of(ChatHandlerResource.TASK_ID_HEADER, taskId));
}