diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2017-08-30 13:27:07 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2017-08-30 13:27:07 +0200 |
commit | 2b06022f3ebc63bd211961c83307bbf4f4c286cb (patch) | |
tree | 7c67c36b494c5dd6cd5598e5749fe9c3d8836e62 /vespajlib/src/main/java/com/yahoo/data | |
parent | 6c5dc8f0bdabeec182ee4ebe566080f8a7ff072f (diff) |
Nonfunctional changes
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo/data')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/data/access/Inspector.java | 79 |
1 files changed, 43 insertions, 36 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/data/access/Inspector.java b/vespajlib/src/main/java/com/yahoo/data/access/Inspector.java index 5bf8016aad3..bb4487e68d6 100644 --- a/vespajlib/src/main/java/com/yahoo/data/access/Inspector.java +++ b/vespajlib/src/main/java/com/yahoo/data/access/Inspector.java @@ -12,7 +12,9 @@ import java.util.Map; * Instrospection methods are available, but you can also use accessors * with a default value if you expect a certain type and just want your * default value if some field doesn't exist or was of the wrong type. - **/ + * + * @author havardpe + */ public interface Inspector extends Inspectable { /** @@ -20,55 +22,55 @@ public interface Inspector extends Inspectable { * If you try to access a field or array entry that does not exist, * you will get an invalid Inspector returned. */ - public boolean valid(); + boolean valid(); /** Get the type of an inspector */ - public Type type(); + Type type(); /** Get the number of entries in an ARRAY (always returns 0 for non-arrays) */ - public int entryCount(); + int entryCount(); /** Get the number of fields in an OBJECT (always returns 0 for non-objects) */ - public int fieldCount(); + int fieldCount(); /** Access the inspector's value if it's a BOOLEAN; otherwise throws exception */ - public boolean asBool(); + boolean asBool(); /** Access the inspector's value if it's a LONG (or DOUBLE); otherwise throws exception */ - public long asLong(); + long asLong(); /** Access the inspector's value if it's a DOUBLE (or LONG); otherwise throws exception */ - public double asDouble(); + double asDouble(); /** Access the inspector's value if it's a STRING; otherwise throws exception */ - public String asString(); + String asString(); /** * Access the inspector's value (in utf-8 representation) if it's * a STRING; otherwise throws exception - **/ - public byte[] asUtf8(); + */ + byte[] asUtf8(); /** Access the inspector's value if it's DATA; otherwise throws exception */ - public byte[] asData(); + byte[] asData(); /** Get the inspector's value (or the supplied default), never throws */ - public boolean asBool(boolean defaultValue); + boolean asBool(boolean defaultValue); /** Get the inspector's value (or the supplied default), never throws */ - public long asLong(long defaultValue); + long asLong(long defaultValue); /** Get the inspector's value (or the supplied default), never throws */ - public double asDouble(double defaultValue); + double asDouble(double defaultValue); /** Get the inspector's value (or the supplied default), never throws */ - public String asString(String defaultValue); + String asString(String defaultValue); /** Get the inspector's value (or the supplied default), never throws */ - public byte[] asUtf8(byte[] defaultValue); + byte[] asUtf8(byte[] defaultValue); /** Get the inspector's value (or the supplied default), never throws */ - public byte[] asData(byte[] defaultValue); + byte[] asData(byte[] defaultValue); /** * Traverse an array value, performing callbacks for each entry. @@ -76,10 +78,11 @@ public interface Inspector extends Inspectable { * If the current Inspector is connected to an array value, * perform callbacks to the given traverser for each entry * contained in the array. Otherwise a no-op. - * @param at traverser callback object. - **/ + * + * @param at traverser callback object + */ @SuppressWarnings("overloads") - public void traverse(ArrayTraverser at); + void traverse(ArrayTraverser at); /** * Traverse an object value, performing callbacks for each field. @@ -87,10 +90,11 @@ public interface Inspector extends Inspectable { * If the current Inspector is connected to an object value, * perform callbacks to the given traverser for each field * contained in the object. Otherwise a no-op. - * @param ot traverser callback object. - **/ + * + * @param ot traverser callback object + */ @SuppressWarnings("overloads") - public void traverse(ObjectTraverser ot); + void traverse(ObjectTraverser ot); /** * Access an array entry. @@ -98,10 +102,11 @@ public interface Inspector extends Inspectable { * If the current Inspector doesn't connect to an array value, * or the given array index is out of bounds, the returned * Inspector will be invalid. - * @param idx array index. - * @return a new Inspector for the entry value. - **/ - public Inspector entry(int idx); + * + * @param idx array index + * @return a new Inspector for the entry value + */ + Inspector entry(int idx); /** * Access an field in an object. @@ -109,20 +114,22 @@ public interface Inspector extends Inspectable { * If the current Inspector doesn't connect to an object value, or * the object value does not contain a field with the given symbol * name, the returned Inspector will be invalid. - * @param name symbol name. - * @return a new Inspector for the field value. - **/ - public Inspector field(String name); + * + * @param name symbol name + * @return a new Inspector for the field value + */ + Inspector field(String name); /** * Convert an array to an iterable list. Other types will just * return an empty list. - **/ - public Iterable<Inspector> entries(); + */ + Iterable<Inspector> entries(); /** * Convert an object to an iterable list of (name, value) pairs. * Other types will just return an empty list. - **/ - public Iterable<Map.Entry<String,Inspector>> fields(); + */ + Iterable<Map.Entry<String,Inspector>> fields(); + } |