本文整理匯總了Java中com.google.common.collect.ImmutableBiMap.get方法的典型用法代碼示例。如果您正苦於以下問題:Java ImmutableBiMap.get方法的具體用法?Java ImmutableBiMap.get怎麽用?Java ImmutableBiMap.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.common.collect.ImmutableBiMap
的用法示例。
在下文中一共展示了ImmutableBiMap.get方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: upperToHttpHeaderName
import com.google.common.collect.ImmutableBiMap; //導入方法依賴的package包/類
private static String upperToHttpHeaderName(
String constantName,
ImmutableBiMap<String, String> specialCases,
ImmutableSet<String> uppercaseAcronyms) {
if (specialCases.containsKey(constantName)) {
return specialCases.get(constantName);
}
List<String> parts = Lists.newArrayList();
for (String part : SPLITTER.split(constantName)) {
if (!uppercaseAcronyms.contains(part)) {
part = part.charAt(0) + Ascii.toLowerCase(part.substring(1));
}
parts.add(part);
}
return JOINER.join(parts);
}
示例2: createMdsalProtocols
import com.google.common.collect.ImmutableBiMap; //導入方法依賴的package包/類
public static List<ProtocolEntry> createMdsalProtocols(Bridge bridge) {
Set<String> protocols = null;
try {
protocols = bridge.getProtocolsColumn().getData();
} catch (SchemaVersionMismatchException e) {
schemaMismatchLog("protocols", "Bridge", e);
}
List<ProtocolEntry> protocolList = new ArrayList<>();
if (protocols != null && protocols.size() > 0) {
ImmutableBiMap<String, Class<? extends OvsdbBridgeProtocolBase>> mapper =
SouthboundConstants.OVSDB_PROTOCOL_MAP.inverse();
for (String protocol : protocols) {
if (protocol != null && mapper.get(protocol) != null) {
protocolList.add(new ProtocolEntryBuilder().setProtocol(mapper.get(protocol)).build());
}
}
}
return protocolList;
}
示例3: createQosType
import com.google.common.collect.ImmutableBiMap; //導入方法依賴的package包/類
/**
* Return the MD-SAL QoS type class corresponding to the QoS type {@link Qos}.
*
* @param type the QoS type to match {@link String}
* @return class matching the input QoS type {@link QosTypeBase}
*/
public static Class<? extends QosTypeBase> createQosType(String type) {
Preconditions.checkNotNull(type);
if (type.isEmpty()) {
LOG.info("QoS type not supplied");
return QosTypeBase.class;
} else {
ImmutableBiMap<String, Class<? extends QosTypeBase>> mapper =
SouthboundConstants.QOS_TYPE_MAP.inverse();
if (mapper.get(type) == null) {
LOG.info("QoS type not found in model: {}", type);
return QosTypeBase.class;
} else {
return mapper.get(type);
}
}
}
示例4: upperToHttpHeaderName
import com.google.common.collect.ImmutableBiMap; //導入方法依賴的package包/類
private static String upperToHttpHeaderName(String constantName,
ImmutableBiMap<String, String> specialCases, ImmutableSet<String> uppercaseAcronyms) {
if (specialCases.containsKey(constantName)) {
return specialCases.get(constantName);
}
List<String> parts = Lists.newArrayList();
for (String part : SPLITTER.split(constantName)) {
if (!uppercaseAcronyms.contains(part)) {
part = part.charAt(0) + Ascii.toLowerCase(part.substring(1));
}
parts.add(part);
}
return JOINER.join(parts);
}
示例5: createEncapsulationType
import com.google.common.collect.ImmutableBiMap; //導入方法依賴的package包/類
public static Class<? extends EncapsulationTypeBase> createEncapsulationType(String type) {
Preconditions.checkNotNull(type);
if (type.isEmpty()) {
return EncapsulationTypeVxlanOverIpv4.class;
} else {
ImmutableBiMap<Class<? extends EncapsulationTypeBase>, String> encapsTypeMap
= new ImmutableBiMap.Builder<Class<? extends EncapsulationTypeBase>, String>()
.put(EncapsulationTypeVxlanOverIpv4.class, "vxlan_over_ipv4")
.build();
ImmutableBiMap<String, Class<? extends EncapsulationTypeBase>> mapper =
encapsTypeMap.inverse();
return mapper.get(type);
}
}
示例6: toMd
import com.google.common.collect.ImmutableBiMap; //導入方法依賴的package包/類
@Override
protected Listener toMd(NeutronLoadBalancerListener listener) {
final ListenerBuilder listenerBuilder = new ListenerBuilder();
toMdBaseAttributes(listener, listenerBuilder);
listenerBuilder.setAdminStateUp(listener.getLoadBalancerListenerAdminStateIsUp());
if (listener.getNeutronLoadBalancerListenerConnectionLimit() != null) {
listenerBuilder.setConnectionLimit(listener.getNeutronLoadBalancerListenerConnectionLimit());
}
if (listener.getNeutronLoadBalancerListenerDefaultPoolID() != null) {
listenerBuilder.setDefaultPoolId(toUuid(listener.getNeutronLoadBalancerListenerDefaultPoolID()));
}
if (listener.getNeutronLoadBalancerListenerLoadBalancerIDs() != null) {
final List<Uuid> listLoadBalancers = new ArrayList<>();
for (final NeutronID neutronId : listener.getNeutronLoadBalancerListenerLoadBalancerIDs()) {
listLoadBalancers.add(toUuid(neutronId.getID()));
}
listenerBuilder.setLoadbalancers(listLoadBalancers);
}
if (listener.getNeutronLoadBalancerListenerProtocol() != null) {
final ImmutableBiMap<String, Class<? extends ProtocolBase>> mapper = PROTOCOL_MAP.inverse();
Class<? extends ProtocolBase> protocol = mapper.get(listener.getNeutronLoadBalancerListenerProtocol());
if (protocol != null) {
listenerBuilder.setProtocol(protocol);
} else {
throw new BadRequestException("Protocol {" + listener.getNeutronLoadBalancerListenerProtocol()
+ "} is not supported");
}
}
if (listener.getNeutronLoadBalancerListenerProtocolPort() != null) {
listenerBuilder.setProtocolPort(Integer.valueOf(listener.getNeutronLoadBalancerListenerProtocolPort()));
}
return listenerBuilder.build();
}
示例7: createDatapathType
import com.google.common.collect.ImmutableBiMap; //導入方法依賴的package包/類
public static Class<? extends DatapathTypeBase> createDatapathType(String type) {
Preconditions.checkNotNull(type);
if (type.isEmpty()) {
return DatapathTypeSystem.class;
} else {
ImmutableBiMap<String, Class<? extends DatapathTypeBase>> mapper =
SouthboundConstants.DATAPATH_TYPE_MAP.inverse();
return mapper.get(type);
}
}
示例8: createEncapsulationType
import com.google.common.collect.ImmutableBiMap; //導入方法依賴的package包/類
public static Class<? extends EncapsulationTypeBase> createEncapsulationType(String type) {
Preconditions.checkNotNull(type);
if (type.isEmpty()) {
return EncapsulationTypeVxlanOverIpv4.class;
} else {
ImmutableBiMap<String, Class<? extends EncapsulationTypeBase>> mapper =
HwvtepSouthboundConstants.ENCAPS_TYPE_MAP.inverse();
return mapper.get(type);
}
}
示例9: getName
import com.google.common.collect.ImmutableBiMap; //導入方法依賴的package包/類
public static String getName(Class<? extends FwProtocolBase> key) {
ImmutableBiMap<Class<? extends FwProtocolBase>, String> inverseMapper = MAPPER.inverse();
return inverseMapper.get(key);
}
示例10: getMinimumBandwidthRuleDirectionString
import com.google.common.collect.ImmutableBiMap; //導入方法依賴的package包/類
public static String getMinimumBandwidthRuleDirectionString(Class<? extends DirectionMinimumBandwidthRule>
minimumBandwidthKey) {
ImmutableBiMap<Class<? extends DirectionMinimumBandwidthRule>, String>
inverseMinimBandwidthRuleDirectionMapper = MINIMUMBANDWIDTHRULE_MAPPER.inverse();
return inverseMinimBandwidthRuleDirectionMapper.get(minimumBandwidthKey);
}
示例11: createOvsdbInterfaceType
import com.google.common.collect.ImmutableBiMap; //導入方法依賴的package包/類
public static String createOvsdbInterfaceType(Class<? extends InterfaceTypeBase> mdsaltype) {
Preconditions.checkNotNull(mdsaltype);
ImmutableBiMap<Class<? extends InterfaceTypeBase>, String> mapper =
SouthboundConstants.OVSDB_INTERFACE_TYPE_MAP.inverse();
return mapper.get(mdsaltype);
}