| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,13 +24,11 @@ | |||
| 24 | 24 | * MessagePack's Array type can represent sequence of values. | |
| 25 | 25 | */ | |
| 26 | 26 | public interface ArrayValue extends Value, Iterable<Value> { | |
| 27 | - @Override | ||
| 28 | - public ImmutableArrayValue toImmutable(); | ||
| 29 | 27 | ||
| 30 | 28 | /** | |
| 31 | 29 | * Returns number of elements in this array. | |
| 32 | 30 | */ | |
| 33 | - public int size(); | ||
| 31 | + int size(); | ||
| 34 | 32 | ||
| 35 | 33 | /** | |
| 36 | 34 | * Returns the element at the specified position in this array. | |
@@ -39,21 +37,21 @@ public interface ArrayValue extends Value, Iterable<Value> { | |||
| 39 | 37 | * If the index is out of range | |
| 40 | 38 | * (<tt>index < 0 || index >= size()</tt>) | |
| 41 | 39 | */ | |
| 42 | - public Value get(int index); | ||
| 40 | + Value get(int index); | ||
| 43 | 41 | ||
| 44 | 42 | /** | |
| 45 | 43 | * Returns the element at the specified position in this array. | |
| 46 | 44 | * This method returns an ImmutableNilValue if the index is out of range. | |
| 47 | 45 | */ | |
| 48 | - public Value getOrNilValue(int index); | ||
| 46 | + Value getOrNilValue(int index); | ||
| 49 | 47 | ||
| 50 | 48 | /** | |
| 51 | 49 | * Returns an iterator over elements. | |
| 52 | 50 | */ | |
| 53 | - public Iterator<Value> iterator(); | ||
| 51 | + Iterator<Value> iterator(); | ||
| 54 | 52 | ||
| 55 | 53 | /** | |
| 56 | 54 | * Returns the value as {@code List}. | |
| 57 | 55 | */ | |
| 58 | - public List<Value> list(); | ||
| 56 | + List<Value> list(); | ||
| 59 | 57 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,6 +23,4 @@ | |||
| 23 | 23 | * @see org.msgpack.value.RawValue | |
| 24 | 24 | */ | |
| 25 | 25 | public interface BinaryValue extends RawValue { | |
| 26 | - @Override | ||
| 27 | - public ImmutableBinaryValue toImmutable(); | ||
| 28 | 26 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,11 +21,8 @@ | |||
| 21 | 21 | * MessagePack's Boolean type can represent {@code true} or {@code false}. | |
| 22 | 22 | */ | |
| 23 | 23 | public interface BooleanValue extends Value { | |
| 24 | - @Override | ||
| 25 | - public ImmutableBooleanValue toImmutable(); | ||
| 26 | - | ||
| 27 | 24 | /** | |
| 28 | 25 | * Returns the value as a {@code boolean}. | |
| 29 | 26 | */ | |
| 30 | - public boolean getBoolean(); | ||
| 27 | + boolean getBoolean(); | ||
| 31 | 28 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,10 +24,7 @@ | |||
| 24 | 24 | * As the type information, applications can use 0 to 127 as the application-specific types. -1 to -128 is reserved for MessagePack's future extension. | |
| 25 | 25 | */ | |
| 26 | 26 | public interface ExtensionValue extends Value { | |
| 27 | - @Override | ||
| 28 | - public ImmutableExtensionValue toImmutable(); | ||
| 27 | + byte getType(); | ||
| 29 | 28 | ||
| 30 | - public byte getType(); | ||
| 31 | - | ||
| 32 | - public byte[] getData(); | ||
| 29 | + byte[] getData(); | ||
| 33 | 30 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,6 +23,4 @@ | |||
| 23 | 23 | * @see org.msgpack.value.NumberValue | |
| 24 | 24 | */ | |
| 25 | 25 | public interface FloatValue extends NumberValue { | |
| 26 | - @Override | ||
| 27 | - public ImmutableFloatValue toImmutable(); | ||
| 28 | 26 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,11 +24,11 @@ public interface ImmutableArrayValue extends ArrayValue, ImmutableValue { | |||
| 24 | 24 | * Returns an iterator over elements. | |
| 25 | 25 | * Returned Iterator does not support {@code remove()} method since the value is immutable. | |
| 26 | 26 | */ | |
| 27 | - public Iterator<Value> iterator(); | ||
| 27 | + Iterator<Value> iterator(); | ||
| 28 | 28 | ||
| 29 | 29 | /** | |
| 30 | 30 | * Returns the value as {@code List}. | |
| 31 | 31 | * Returned List is immutable. It does not support {@code put()}, {@code clear()}, or other methods that modify the value. | |
| 32 | 32 | */ | |
| 33 | - public List<Value> list(); | ||
| 33 | + List<Value> list(); | ||
| 34 | 34 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,70 +16,68 @@ | |||
| 16 | 16 | package org.msgpack.value; | |
| 17 | 17 | ||
| 18 | 18 | import java.math.BigInteger; | |
| 19 | + import org.msgpack.core.MessageOverflowException; | ||
| 19 | 20 | ||
| 20 | 21 | /** | |
| 21 | 22 | * The interface {@code IntegerValue} represents MessagePack's Integer type. | |
| 22 | 23 | * | |
| 23 | 24 | * MessagePack's Integer type can represent from -2<sup>63</sup> to 2<sup>64</sup>-1. | |
| 24 | 25 | */ | |
| 25 | 26 | public interface IntegerValue extends NumberValue { | |
| 26 | - @Override | ||
| 27 | - public ImmutableIntegerValue toImmutable(); | ||
| 28 | - | ||
| 29 | 27 | /** | |
| 30 | 28 | * Returns true if the value is in the range of [-2<sup>7</sup> to 2<sup>7</sup>-1]. | |
| 31 | 29 | */ | |
| 32 | - public boolean isInByteRange(); | ||
| 30 | + boolean isInByteRange(); | ||
| 33 | 31 | ||
| 34 | 32 | /** | |
| 35 | 33 | * Returns true if the value is in the range of [-2<sup>15</sup> to 2<sup>15</sup>-1] | |
| 36 | 34 | */ | |
| 37 | - public boolean isInShortRange(); | ||
| 35 | + boolean isInShortRange(); | ||
| 38 | 36 | ||
| 39 | 37 | /** | |
| 40 | 38 | * Returns true if the value is in the range of [-2<sup>31</sup> to 2<sup>31</sup>-1] | |
| 41 | 39 | */ | |
| 42 | - public boolean isInIntRange(); | ||
| 40 | + boolean isInIntRange(); | ||
| 43 | 41 | ||
| 44 | 42 | /** | |
| 45 | 43 | * Returns true if the value is in the range of [-2<sup>63</sup> to 2<sup>63</sup>-1] | |
| 46 | 44 | */ | |
| 47 | - public boolean isInLongRange(); | ||
| 45 | + boolean isInLongRange(); | ||
| 48 | 46 | ||
| 49 | 47 | /** | |
| 50 | 48 | * Returns the value as a {@code byte}, otherwise throws an exception. | |
| 51 | 49 | * | |
| 52 | - * @throws MessageIntegerOverflowException | ||
| 50 | + * @throws MessageOverflowException | ||
| 53 | 51 | * If the value does not fit in the range of {@code byte} type. | |
| 54 | 52 | */ | |
| 55 | - public byte getByte(); | ||
| 53 | + byte getByte(); | ||
| 56 | 54 | ||
| 57 | 55 | /** | |
| 58 | 56 | * Returns the value as a {@code short}, otherwise throws an exception. | |
| 59 | 57 | * | |
| 60 | - * @throws MessageIntegerOverflowException | ||
| 58 | + * @throws MessageOverflowException | ||
| 61 | 59 | * If the value does not fit in the range of {@code short} type. | |
| 62 | 60 | */ | |
| 63 | - public short getShort(); | ||
| 61 | + short getShort(); | ||
| 64 | 62 | ||
| 65 | 63 | /** | |
| 66 | 64 | * Returns the value as an {@code int}, otherwise throws an exception. | |
| 67 | 65 | * | |
| 68 | - * @throws MessageIntegerOverflowException | ||
| 66 | + * @throws MessageOverflowException | ||
| 69 | 67 | * If the value does not fit in the range of {@code int} type. | |
| 70 | 68 | */ | |
| 71 | - public int getInt(); | ||
| 69 | + int getInt(); | ||
| 72 | 70 | ||
| 73 | 71 | /** | |
| 74 | 72 | * Returns the value as a {@code long}, otherwise throws an exception. | |
| 75 | 73 | * | |
| 76 | - * @throws MessageIntegerOverflowException | ||
| 74 | + * @throws MessageOverflowException | ||
| 77 | 75 | * If the value does not fit in the range of {@code long} type. | |
| 78 | 76 | */ | |
| 79 | - public long getLong(); | ||
| 77 | + long getLong(); | ||
| 80 | 78 | ||
| 81 | 79 | /** | |
| 82 | 80 | * Returns the value as a {@code BigInteger}. | |
| 83 | 81 | */ | |
| 84 | - public BigInteger getBigInteger(); | ||
| 82 | + BigInteger getBigInteger(); | ||
| 85 | 83 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,24 +25,21 @@ | |||
| 25 | 25 | * MessagePack's Map type can represent sequence of key-value pairs. | |
| 26 | 26 | */ | |
| 27 | 27 | public interface MapValue extends Value { | |
| 28 | - @Override | ||
| 29 | - public ImmutableMapValue toImmutable(); | ||
| 30 | - | ||
| 31 | 28 | /** | |
| 32 | 29 | * Returns number of key-value pairs in this array. | |
| 33 | 30 | */ | |
| 34 | - public int size(); | ||
| 31 | + int size(); | ||
| 35 | 32 | ||
| 36 | - public Set<Value> keySet(); | ||
| 33 | + Set<Value> keySet(); | ||
| 37 | 34 | ||
| 38 | - public Set<Map.Entry<Value, Value>> entrySet(); | ||
| 35 | + Set<Map.Entry<Value, Value>> entrySet(); | ||
| 39 | 36 | ||
| 40 | - public Collection<Value> values(); | ||
| 37 | + Collection<Value> values(); | ||
| 41 | 38 | ||
| 42 | 39 | /** | |
| 43 | 40 | * Returns the value as {@code Map}. | |
| 44 | 41 | */ | |
| 45 | - public Map<Value, Value> map(); | ||
| 42 | + Map<Value, Value> map(); | ||
| 46 | 43 | ||
| 47 | 44 | /** | |
| 48 | 45 | * Returns the key-value pairs as an array of {@code Value}. | |
@@ -51,5 +48,5 @@ public interface MapValue extends Value { | |||
| 51 | 48 | * | |
| 52 | 49 | * For example, if this value represents <code>{"k1": "v1", "k2": "v2"}</code>, this method returns ["k1", "v1", "k2", "v2"]. | |
| 53 | 50 | */ | |
| 54 | - public Value[] getKeyValueArray(); | ||
| 51 | + Value[] getKeyValueArray(); | ||
| 55 | 52 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,6 +19,4 @@ | |||
| 19 | 19 | * The interface {@code NilValue} represents MessagePack's Nil type. | |
| 20 | 20 | */ | |
| 21 | 21 | public interface NilValue extends Value { | |
| 22 | - @Override | ||
| 23 | - public ImmutableNilValue toImmutable(); | ||
| 24 | 22 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,6 +16,7 @@ | |||
| 16 | 16 | package org.msgpack.value; | |
| 17 | 17 | ||
| 18 | 18 | import java.nio.ByteBuffer; | |
| 19 | + import org.msgpack.core.MessageStringCodingException; | ||
| 19 | 20 | ||
| 20 | 21 | /** | |
| 21 | 22 | * The interface {@code RawValue} represents MessagePack's Raw type, which means Binary or String type. | |
@@ -26,23 +27,20 @@ | |||
| 26 | 27 | * @see org.msgpack.value.BinaryValue | |
| 27 | 28 | */ | |
| 28 | 29 | public interface RawValue extends Value { | |
| 29 | - @Override | ||
| 30 | - public ImmutableRawValue toImmutable(); | ||
| 31 | - | ||
| 32 | 30 | /** | |
| 33 | 31 | * Returns the value as {@code byte[]}. | |
| 34 | 32 | * | |
| 35 | 33 | * This method copies the byte array. | |
| 36 | 34 | */ | |
| 37 | - public byte[] getByteArray(); | ||
| 35 | + byte[] getByteArray(); | ||
| 38 | 36 | ||
| 39 | 37 | /** | |
| 40 | 38 | * Returns the value as {@code ByteBuffer}. | |
| 41 | 39 | * | |
| 42 | 40 | * Returned ByteBuffer is read-only. See {@code#asReadOnlyBuffer()}. | |
| 43 | 41 | * This method doesn't copy the byte array as much as possible. | |
| 44 | 42 | */ | |
| 45 | - public ByteBuffer getByteBuffer(); | ||
| 43 | + ByteBuffer getByteBuffer(); | ||
| 46 | 44 | ||
| 47 | 45 | /** | |
| 48 | 46 | * Returns the value as {@code String}. | |
@@ -52,12 +50,12 @@ public interface RawValue extends Value { | |||
| 52 | 50 | * @throws MessageStringCodingException | |
| 53 | 51 | * If this value includes invalid UTF-8 byte sequence. | |
| 54 | 52 | */ | |
| 55 | - public String getString(); | ||
| 53 | + String getString(); | ||
| 56 | 54 | ||
| 57 | 55 | /** | |
| 58 | 56 | * Returns the value as {@code String}. | |
| 59 | 57 | * | |
| 60 | 58 | * This method replaces an invalid UTF-8 byte sequence with <code>U+FFFD replacement character</code>. | |
| 61 | 59 | */ | |
| 62 | - public String stringValue(); | ||
| 60 | + String stringValue(); | ||
| 63 | 61 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments