Skip to content

Commit 8393fda

Browse files
committed
Extend tests for Draft_6455
1 parent 0924bac commit 8393fda

File tree

2 files changed

+316
-6
lines changed

2 files changed

+316
-6
lines changed

src/main/java/org/java_websocket/framing/FramedataImpl1.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,4 +239,32 @@ public static FramedataImpl1 get(Opcode opcode) {
239239
throw new IllegalArgumentException("Supplied opcode is invalid");
240240
}
241241
}
242+
243+
@Override
244+
public boolean equals( Object o ) {
245+
if( this == o ) return true;
246+
if( o == null || getClass() != o.getClass() ) return false;
247+
248+
FramedataImpl1 that = ( FramedataImpl1 ) o;
249+
250+
if( fin != that.fin ) return false;
251+
if( transferemasked != that.transferemasked ) return false;
252+
if( rsv1 != that.rsv1 ) return false;
253+
if( rsv2 != that.rsv2 ) return false;
254+
if( rsv3 != that.rsv3 ) return false;
255+
if( optcode != that.optcode ) return false;
256+
return unmaskedpayload != null ? unmaskedpayload.equals( that.unmaskedpayload ) : that.unmaskedpayload == null;
257+
}
258+
259+
@Override
260+
public int hashCode() {
261+
int result = ( fin ? 1 : 0 );
262+
result = 31 * result + optcode.hashCode();
263+
result = 31 * result + ( unmaskedpayload != null ? unmaskedpayload.hashCode() : 0 );
264+
result = 31 * result + ( transferemasked ? 1 : 0 );
265+
result = 31 * result + ( rsv1 ? 1 : 0 );
266+
result = 31 * result + ( rsv2 ? 1 : 0 );
267+
result = 31 * result + ( rsv3 ? 1 : 0 );
268+
return result;
269+
}
242270
}

0 commit comments

Comments
 (0)