1414import java .util .List ;
1515import java .util .Set ;
1616
17- import edu . umd . cs . findbugs . annotations .NonNull ;
18- import edu . umd . cs . findbugs . annotations . Nullable ;
17+ import org . jspecify . annotations .Nullable ;
18+
1919import io .jooby .exception .MissingValueException ;
2020import io .jooby .internal .ByteArrayBody ;
2121import io .jooby .internal .FileBody ;
@@ -39,7 +39,7 @@ public interface Body extends Value {
3939 * @param charset Charset.
4040 * @return Body as string.
4141 */
42- default String value (@ NonNull Charset charset ) {
42+ default String value (Charset charset ) {
4343 byte [] bytes = bytes ();
4444 if (bytes .length == 0 ) {
4545 throw new MissingValueException ("body" );
@@ -99,7 +99,7 @@ default Iterator<Value> iterator() {
9999 InputStream stream ();
100100
101101 @ Override
102- default <T > List <T > toList (@ NonNull Class <T > type ) {
102+ default <T > List <T > toList (Class <T > type ) {
103103 return to (Reified .list (type ).getType ());
104104 }
105105
@@ -112,11 +112,11 @@ default <T> List<T> toList(@NonNull Class<T> type) {
112112 }
113113
114114 @ Override
115- default <T > T to (@ NonNull Class <T > type ) {
115+ default <T > T to (Class <T > type ) {
116116 return to ((Type ) type );
117117 }
118118
119- default @ Nullable @ Override <T > T toNullable (@ NonNull Class <T > type ) {
119+ default @ Nullable @ Override <T > T toNullable (Class <T > type ) {
120120 return toNullable ((Type ) type );
121121 }
122122
@@ -127,7 +127,7 @@ default <T> T to(@NonNull Class<T> type) {
127127 * @param <T> Generic type.
128128 * @return Converted value.
129129 */
130- <T > T to (@ NonNull Type type );
130+ <T > T to (Type type );
131131
132132 /**
133133 * Convert this body into the given type.
@@ -136,7 +136,7 @@ default <T> T to(@NonNull Class<T> type) {
136136 * @param <T> Generic type.
137137 * @return Converted value or <code>null</code>.
138138 */
139- @ Nullable <T > T toNullable (@ NonNull Type type );
139+ @ Nullable <T > T toNullable (Type type );
140140
141141 /* **********************************************************************************************
142142 * Factory methods:
@@ -149,7 +149,7 @@ default <T> T to(@NonNull Class<T> type) {
149149 * @param ctx Current context.
150150 * @return Empty body.
151151 */
152- static Body empty (@ NonNull Context ctx ) {
152+ static Body empty (Context ctx ) {
153153 return ByteArrayBody .empty (ctx );
154154 }
155155
@@ -161,7 +161,7 @@ static Body empty(@NonNull Context ctx) {
161161 * @param size Size in bytes or <code>-1</code>.
162162 * @return A new body.
163163 */
164- static Body of (@ NonNull Context ctx , @ NonNull InputStream stream , long size ) {
164+ static Body of (Context ctx , InputStream stream , long size ) {
165165 return new InputStreamBody (ctx , stream , size );
166166 }
167167
@@ -172,7 +172,7 @@ static Body of(@NonNull Context ctx, @NonNull InputStream stream, long size) {
172172 * @param bytes byte array.
173173 * @return A new body.
174174 */
175- static Body of (@ NonNull Context ctx , @ NonNull byte [] bytes ) {
175+ static Body of (Context ctx , byte [] bytes ) {
176176 return new ByteArrayBody (ctx , bytes );
177177 }
178178
@@ -183,7 +183,7 @@ static Body of(@NonNull Context ctx, @NonNull byte[] bytes) {
183183 * @param file File.
184184 * @return A new body.
185185 */
186- static Body of (@ NonNull Context ctx , @ NonNull Path file ) {
186+ static Body of (Context ctx , Path file ) {
187187 return new FileBody (ctx , file );
188188 }
189189}
0 commit comments