本文整理汇总了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);
}