Skip to content

Commit

Permalink
issue #679 - rename classes per PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
  • Loading branch information
lmsurpre committed Feb 5, 2020
1 parent ac3e1bd commit bc19aa2
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
import com.ibm.fhir.path.exception.FHIRPathException;
import com.ibm.fhir.path.util.FHIRPathUtil;

public class FHIRPatchAdd extends FHIRPathPatchOperation {
public class FHIRPathPatchAdd extends FHIRPathPatchOperation {
String fhirPath;
String name;
Element value;

public FHIRPatchAdd(String fhirPath, String name, Element value) {
public FHIRPathPatchAdd(String fhirPath, String name, Element value) {
this.fhirPath = Objects.requireNonNull(fhirPath);
this.name = Objects.requireNonNull(name);
this.value = Objects.requireNonNull(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
import com.ibm.fhir.path.exception.FHIRPathException;
import com.ibm.fhir.path.util.FHIRPathUtil;

public class FHIRPatchDelete extends FHIRPathPatchOperation {
public class FHIRPathPatchDelete extends FHIRPathPatchOperation {
String fhirPath;
String elementName;

public FHIRPatchDelete(String fhirPath) {
public FHIRPathPatchDelete(String fhirPath) {
this.fhirPath = fhirPath;
this.elementName = getElementName(fhirPath);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
import com.ibm.fhir.path.exception.FHIRPathException;
import com.ibm.fhir.path.util.FHIRPathUtil;

public class FHIRPatchInsert extends FHIRPathPatchOperation {
public class FHIRPathPatchInsert extends FHIRPathPatchOperation {
String fhirPath;
Element value;
int index;
String elementName;

public FHIRPatchInsert(String fhirPath, Element value, Integer index) {
public FHIRPathPatchInsert(String fhirPath, Element value, Integer index) {
this.fhirPath = Objects.requireNonNull(fhirPath);
this.value = Objects.requireNonNull(value);
this.index = Objects.requireNonNull(index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
import com.ibm.fhir.path.exception.FHIRPathException;
import com.ibm.fhir.path.util.FHIRPathUtil;

public class FHIRPatchMove extends FHIRPathPatchOperation {
public class FHIRPathPatchMove extends FHIRPathPatchOperation {
String fhirPath;
int source;
int destination;
String elementName;

public FHIRPatchMove(String fhirPath, Integer source, Integer destination) {
public FHIRPathPatchMove(String fhirPath, Integer source, Integer destination) {
this.fhirPath = Objects.requireNonNull(fhirPath);
this.source = Objects.requireNonNull(source);
this.destination = Objects.requireNonNull(destination);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public abstract class FHIRPathPatchOperation implements FHIRPatch {
*/
public static FHIRPathPatchOperation parse(Parameter operation) {
boolean foundType = false, foundPath = false, foundName = false, foundValue = false, foundIndex = false, foundSource = false, foundDestination = false;
FHIRPatchType type = null;
FHIRPathPatchType type = null;
String fhirPath = null;
String name = null;
Element value = null;
Expand All @@ -39,7 +39,7 @@ public static FHIRPathPatchOperation parse(Parameter operation) {
switch (partName) {
case TYPE:
Code valueCode = validatePartAndGetValue(foundType, part, Code.class);
type = FHIRPatchType.from(valueCode.getValue());
type = FHIRPathPatchType.from(valueCode.getValue());
foundType = true;
break;
case PATH:
Expand Down Expand Up @@ -78,11 +78,11 @@ public static FHIRPathPatchOperation parse(Parameter operation) {
}
try {
switch (type) {
case ADD: return new FHIRPatchAdd(fhirPath, name, value);
case DELETE: return new FHIRPatchDelete(fhirPath);
case INSERT: return new FHIRPatchInsert(fhirPath, value, index);
case MOVE: return new FHIRPatchMove(fhirPath, source, destination);
case REPLACE: return new FHIRPatchReplace(fhirPath, value);
case ADD: return new FHIRPathPatchAdd(fhirPath, name, value);
case DELETE: return new FHIRPathPatchDelete(fhirPath);
case INSERT: return new FHIRPathPatchInsert(fhirPath, value, index);
case MOVE: return new FHIRPathPatchMove(fhirPath, source, destination);
case REPLACE: return new FHIRPathPatchReplace(fhirPath, value);
default:
throw new IllegalArgumentException("Invalid FHIRPath patch operation type: " + type.name());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
import com.ibm.fhir.path.exception.FHIRPathException;
import com.ibm.fhir.path.util.FHIRPathUtil;

public class FHIRPatchReplace extends FHIRPathPatchOperation {
public class FHIRPathPatchReplace extends FHIRPathPatchOperation {
String fhirPath;
Element value;
String elementName;

public FHIRPatchReplace(String fhirPath, Element value) {
public FHIRPathPatchReplace(String fhirPath, Element value) {
this.fhirPath = Objects.requireNonNull(fhirPath);
this.value = Objects.requireNonNull(value);
this.elementName = getElementName(fhirPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* The list of allowed FHIRPath Patch operation types
*/
public enum FHIRPatchType {
public enum FHIRPathPatchType {
/**
* The content will be appended to the element identified in the path, using the name specified.
* Add can used for non-repeating elements as long as they do not already exist.
Expand Down Expand Up @@ -39,16 +39,16 @@ public enum FHIRPatchType {

private final String value;

FHIRPatchType(String value) {
FHIRPathPatchType(String value) {
this.value = value;
}

public java.lang.String value() {
return value;
}

public static FHIRPatchType from(String value) {
for (FHIRPatchType t : FHIRPatchType.values()) {
public static FHIRPathPatchType from(String value) {
for (FHIRPathPatchType t : FHIRPathPatchType.values()) {
if (t.value.equals(value)) {
return t;
}
Expand Down

0 comments on commit bc19aa2

Please sign in to comment.