List of usage examples for com.google.common.collect BiMap forcePut
@Nullable V forcePut(@Nullable K key, @Nullable V value);
From source file:org.spongepowered.tools.obfuscation.mapping.mcp.MappingProviderSrg.java
@Override public void read(final File input) throws IOException { // Locally scoped to avoid synthetic accessor final BiMap<String, String> packageMap = this.packageMap; final BiMap<String, String> classMap = this.classMap; final BiMap<MappingField, MappingField> fieldMap = this.fieldMap; final BiMap<MappingMethod, MappingMethod> methodMap = this.methodMap; Files.readLines(input, Charset.defaultCharset(), new LineProcessor<String>() { @Override/* w w w . ja v a 2s . c o m*/ public String getResult() { return null; } @Override public boolean processLine(String line) throws IOException { if (Strings.isNullOrEmpty(line) || line.startsWith("#")) { return true; } String type = line.substring(0, 2); String[] args = line.substring(4).split(" "); if (type.equals("PK")) { packageMap.forcePut(args[0], args[1]); } else if (type.equals("CL")) { classMap.forcePut(args[0], args[1]); } else if (type.equals("FD")) { fieldMap.forcePut(new MappingFieldSrg(args[0]).copy(), new MappingFieldSrg(args[1]).copy()); } else if (type.equals("MD")) { methodMap.forcePut(new MappingMethod(args[0], args[1]), new MappingMethod(args[2], args[3])); } else { throw new MixinException("Invalid SRG file: " + input); } return true; } }); }