Skip to content

Commit f66bfed

Browse files
committed
Getter for knownExtensions
Creates the possibility to overwrite the copyInstance() method
1 parent a816171 commit f66bfed

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/main/java/org/java_websocket/drafts/Draft_6455.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class Draft_6455 extends Draft {
5555
/**
5656
* Attribute for all available extension in this draft
5757
*/
58-
List<IExtension> knownExtensions;
58+
private List<IExtension> knownExtensions;
5959

6060
/**
6161
* Attribute for the current continuous frame
@@ -158,6 +158,14 @@ public IExtension getExtension() {
158158
return extension;
159159
}
160160

161+
/**
162+
* Getter for all available extensions for this draft
163+
* @return the extensions which are enabled for this draft
164+
*/
165+
public List<IExtension> getKnownExtensions() {
166+
return knownExtensions;
167+
}
168+
161169
@Override
162170
public ClientHandshakeBuilder postProcessHandshakeRequestAsClient( ClientHandshakeBuilder request ) {
163171
request.put( "Upgrade", "websocket" );
@@ -198,7 +206,7 @@ public HandshakeBuilder postProcessHandshakeResponseAsServer( ClientHandshake re
198206
@Override
199207
public Draft copyInstance() {
200208
ArrayList<IExtension> newExtensions = new ArrayList<IExtension>();
201-
for( IExtension extension : knownExtensions ) {
209+
for( IExtension extension : getKnownExtensions() ) {
202210
newExtensions.add( extension.copyInstance() );
203211
}
204212
return new Draft_6455( newExtensions );

0 commit comments

Comments
 (0)