Skip to content

Commit

Permalink
Make isConflicting type overload optional
Browse files Browse the repository at this point in the history
  • Loading branch information
SS111 committed Jul 24, 2013
1 parent 4490dbb commit bbebfaa
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/com/github/ss111/ConflictHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,30 @@ public static Boolean isConflicting(MultiValueMap map, Integer key, String type)
}
}

public static Boolean isConflicting(MultiValueMap map, Integer key) {

@SuppressWarnings("unchecked")
Collection<String> names = map.getCollection(key);

if (names.size() == 1) {

return false;

} else {

String[] namesArray = (String[]) names.toArray(new String[0]);

if (namesArray[0].equals(namesArray[1])) {

return false;

} else {

return true;
}
}
}

public static String getName(MultiValueMap map, Integer key) {

@SuppressWarnings("unchecked")
Expand Down

0 comments on commit bbebfaa

Please sign in to comment.