Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class KeyValuePair<Key, Value> {
- private Key key;
- private Value value;
- private final boolean isEmpty;
- public KeyValuePair(Key key, Value value){
- this.key = key;
- this.value = value;
- isEmpty = false;
- }
- private KeyValuePair(){
- isEmpty = true;
- }
- public static KeyValuePair getEmpty(){
- return new KeyValuePair();
- }
- public Key getKey(){
- return key;
- }
- public Value getValue(){
- return value;
- }
- public boolean hasValue(){
- return (! isEmpty);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement