@@ -33,29 +33,59 @@ private BytesValidators() {
3333 * Checks the length of a byte array
3434 *
3535 * @param byteLength to check against
36- * @return true if longer than given value
36+ * @return true if longer or equal to given value
3737 */
3838 public static BytesValidator atLeast (int byteLength ) {
3939 return new BytesValidator .Length (byteLength , BytesValidator .Length .Mode .GREATER_OR_EQ_THAN );
4040 }
4141
42+ /**
43+ * Checks the length of a byte array
44+ *
45+ * @param byteLength to check against
46+ * @return true if smaller or equal to given value
47+ */
4248 public static BytesValidator atMost (int byteLength ) {
4349 return new BytesValidator .Length (byteLength , BytesValidator .Length .Mode .SMALLER_OR_EQ_THAN );
4450 }
4551
52+ /**
53+ * Checks the length of a byte array
54+ *
55+ * @param byteLength to check against
56+ * @return true if equal to given value
57+ */
4658 public static BytesValidator exactLength (int byteLength ) {
4759 return new BytesValidator .Length (byteLength , BytesValidator .Length .Mode .EXACT );
4860 }
4961
50- public static BytesValidator onlyOf (byte value ) {
51- return new BytesValidator .IdenticalContent (value , BytesValidator .IdenticalContent .Mode .ONLY_OF );
62+ /**
63+ * Checks individual byte content
64+ *
65+ * @param refByte to check against
66+ * @return true if array only consists of refByte
67+ */
68+ public static BytesValidator onlyOf (byte refByte ) {
69+ return new BytesValidator .IdenticalContent (refByte , BytesValidator .IdenticalContent .Mode .ONLY_OF );
5270 }
5371
54- public static BytesValidator notOnlyOf (byte value ) {
55- return new BytesValidator .IdenticalContent (value , BytesValidator .IdenticalContent .Mode .NOT_ONLY_OF );
72+ /**
73+ * Checks individual byte content
74+ *
75+ * @param refByte to check against
76+ * @return true if array has at least one byte that is not refByte
77+ */
78+ public static BytesValidator notOnlyOf (byte refByte ) {
79+ return new BytesValidator .IdenticalContent (refByte , BytesValidator .IdenticalContent .Mode .NOT_ONLY_OF );
5680 }
5781
58- public static BytesValidator noneOf (byte value ) {
59- return new BytesValidator .IdenticalContent (value , BytesValidator .IdenticalContent .Mode .NONE_OF );
82+ /**
83+ * Checks individual byte content
84+ *
85+ * @param refByte to check against
86+ * @return true if array has no value refByte
87+ */
88+ public static BytesValidator noneOf (byte refByte ) {
89+ return new BytesValidator .IdenticalContent (refByte , BytesValidator .IdenticalContent .Mode .NONE_OF );
6090 }
6191}
0 commit comments