public final class VariableMap extends Object
RenameVars
Modifier and Type | Method and Description |
---|---|
static VariableMap |
fromBytes(byte[] bytes)
Deserializes the variable map from a byte array returned by
toBytes() . |
static VariableMap |
fromMap(Map<String,String> map)
Initializes the variable map from an existing map.
|
Map<String,String> |
getNewNameToOriginalNameMap()
Returns an unmodifiable mapping from new names to original names.
|
Map<String,String> |
getOriginalNameToNewNameMap()
Returns an unmodifiable mapping from original names to new names.
|
static VariableMap |
load(String filename)
Reads the variable map from a file written via
save(String) . |
String |
lookupNewName(String sourceName)
Given an original variable name, look up new name, may return null
if it's not found.
|
String |
lookupSourceName(String newName)
Given a new variable name, lookup the source name, may return null
if it's not found.
|
void |
save(String filename)
Saves the variable map to a file.
|
byte[] |
toBytes()
Serializes the variable map to a byte array.
|
public String lookupNewName(String sourceName)
public String lookupSourceName(String newName)
public Map<String,String> getOriginalNameToNewNameMap()
public Map<String,String> getNewNameToOriginalNameMap()
@GwtIncompatible(value="com.google.io.Files") public void save(String filename) throws IOException
IOException
@GwtIncompatible(value="java.io.File") public static VariableMap load(String filename) throws IOException
save(String)
.IOException
@GwtIncompatible(value="java.io.ByteArrayOutputStream") public byte[] toBytes()
@GwtIncompatible(value="com.google.common.base.Splitter.onPattern()") public static VariableMap fromBytes(byte[] bytes) throws ParseException
toBytes()
.ParseException
public static VariableMap fromMap(Map<String,String> map)
map
- The map to use from original names to generated names. It is
copied and changes to the specified map will not affect the returned
object.Copyright © 2009-2017 Google. All Rights Reserved.