public final class ClassRecord extends RenamingRecord implements java.lang.Comparable<ClassRecord>
Constructor and Description |
---|
ClassRecord(java.lang.String name,
java.lang.String newName)
Creates a new renaming record for a class.
|
Modifier and Type | Method and Description |
---|---|
FieldRecord |
addField(java.lang.String fieldName,
java.lang.String fieldSignature,
java.lang.String fieldNewName)
Create a new record for a renamed field in this class.
|
MethodRecord |
addMethod(java.lang.String methodName,
java.lang.String methodSignature,
java.lang.String methodNewName)
Create a new record for a renamed method in this class
|
int |
compareTo(ClassRecord o)
The items are compared by their original names.
|
java.util.Iterator<FieldRecord> |
fields()
Iterate over the field renaming records.
|
FieldRecord |
getField(java.lang.String fieldName)
Get a field by its original name.
|
int |
getFieldCount()
Return the number of field renaming records the class has.
|
java.util.List<FieldRecord> |
getFields()
Get the list of all fields.
|
MethodRecord |
getMethod(java.lang.String methodName,
java.lang.String methodSignature)
Get a method by its original name.
|
int |
getMethodCount()
Return the number of method renaming records the class has.
|
java.util.List<MethodRecord> |
getMethods()
Get the list of all methods.
|
java.util.List<MethodRecord> |
getMethods(java.lang.String methodName)
Get a list of methods by their original names.
|
FieldRecord |
getRenamedField(java.lang.String fieldNewName)
Get a field by it new name.
|
java.util.List<MethodRecord> |
getRenamedMethods(java.lang.String methodNewName)
Get a list of methods by their new names.
|
boolean |
hasFields()
Does the class contain any field renaming information?
|
boolean |
hasMethods()
Does the class contain any method renaming information?
|
java.util.Iterator<MethodRecord> |
methods()
Iterate over the method renaming records.
|
boolean |
removeField(FieldRecord field)
Remove a field from the renaming info.
|
boolean |
removeMethod(MethodRecord method)
Remove a method from the renaming info.
|
java.lang.String |
toString() |
getName, getNewName
public ClassRecord(java.lang.String name, java.lang.String newName)
name
- the original name of the class in either source code or class
file format.newName
- the new name for the class in either source code or class
file format. May be null
to indicate the class
was not renamed.public java.lang.String toString()
toString
in class java.lang.Object
public MethodRecord addMethod(java.lang.String methodName, java.lang.String methodSignature, java.lang.String methodNewName)
methodName
- the original name of the method.methodSignature
- the original signature of the method in class file
format.methodNewName
- the new name for the method. May be
null
to indicate that the method was not renamed.public boolean hasMethods()
true
if the class has information about renamed
methods.public int getMethodCount()
public java.util.Iterator<MethodRecord> methods()
public java.util.List<MethodRecord> getRenamedMethods(java.lang.String methodNewName)
methodNewName
- the new name of the methodpublic java.util.List<MethodRecord> getMethods()
public java.util.List<MethodRecord> getMethods(java.lang.String methodName)
methodName
- the name of the methodpublic MethodRecord getMethod(java.lang.String methodName, java.lang.String methodSignature)
methodName
- the original name of the methodmethodSignature
- the original signature of the method in class file
format.null
if
not found.public boolean removeMethod(MethodRecord method)
method
- the item to removetrue
if the item was removedpublic FieldRecord addField(java.lang.String fieldName, java.lang.String fieldSignature, java.lang.String fieldNewName)
fieldName
- the original name of the field.fieldSignature
- the type of the field in class file format.fieldNewName
- the new name for the field. May be null
to indicate that the field was not renamed.public boolean hasFields()
true
if the class has information about renamed
fields.public int getFieldCount()
public java.util.Iterator<FieldRecord> fields()
public java.util.List<FieldRecord> getFields()
public FieldRecord getField(java.lang.String fieldName)
fieldName
- the name of the field.null
if
not found.public FieldRecord getRenamedField(java.lang.String fieldNewName)
fieldNewName
- the new name of the field.null
if
not found.public boolean removeField(FieldRecord field)
field
- the item to removetrue
if the item was removedpublic int compareTo(ClassRecord o)
compareTo
in interface java.lang.Comparable<ClassRecord>
Copyright 2019 PreEmptive Solutions, LLC. All Rights Reserved.