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

com.google.common.cache.DeepCacheBuilder Maven / Gradle / Ivy

There is a newer version: 5.3.3
Show newest version
package com.google.common.cache;

import com.google.common.base.Equivalence;

import static com.google.common.base.DeepEquivalence.DEEP_EQUIVALENCE;

public class DeepCacheBuilder {
		
	public static final CacheBuilder newBuilder(){
		return newBuilder(DEEP_EQUIVALENCE,DEEP_EQUIVALENCE);
	}
	public static final CacheBuilder newBuilder(
			Equivalence keyEquivalence,
			Equivalence valueEquivalence){
		CacheBuilder builder = CacheBuilder.newBuilder();
		if(keyEquivalence != null){
			builder.keyEquivalence(keyEquivalence);
		}
		if(valueEquivalence != null){
			builder.valueEquivalence(valueEquivalence);	
		}
		return builder;
	}
}