View Javadoc
1   /*
2    * Copyright 2014 The Netty Project
3    *
4    * The Netty Project licenses this file to you under the Apache License,
5    * version 2.0 (the "License"); you may not use this file except in compliance
6    * with the License. You may obtain a copy of the License at:
7    *
8    *   https://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations
14   * under the License.
15   */
16  package io.netty.handler.codec.stomp;
17  
18  
19  import io.netty.buffer.ByteBuf;
20  import io.netty.buffer.DefaultByteBufHolder;
21  import io.netty.handler.codec.DecoderResult;
22  
23  /**
24   * The default {@link StompContentSubframe} implementation.
25   */
26  public class DefaultStompContentSubframe extends DefaultByteBufHolder implements StompContentSubframe {
27      private DecoderResult decoderResult = DecoderResult.SUCCESS;
28  
29      public DefaultStompContentSubframe(ByteBuf content) {
30          super(content);
31      }
32  
33      @Override
34      public StompContentSubframe copy() {
35          return (StompContentSubframe) super.copy();
36      }
37  
38      @Override
39      public StompContentSubframe duplicate() {
40          return (StompContentSubframe) super.duplicate();
41      }
42  
43      @Override
44      public StompContentSubframe retainedDuplicate() {
45          return (StompContentSubframe) super.retainedDuplicate();
46      }
47  
48      @Override
49      public StompContentSubframe replace(ByteBuf content) {
50          return new DefaultStompContentSubframe(content);
51      }
52  
53      @Override
54      public StompContentSubframe retain() {
55          super.retain();
56          return this;
57      }
58  
59      @Override
60      public StompContentSubframe retain(int increment) {
61          super.retain(increment);
62          return this;
63      }
64  
65      @Override
66      public StompContentSubframe touch() {
67          super.touch();
68          return this;
69      }
70  
71      @Override
72      public StompContentSubframe touch(Object hint) {
73          super.touch(hint);
74          return this;
75      }
76  
77      @Override
78      public DecoderResult decoderResult() {
79          return decoderResult;
80      }
81  
82      @Override
83      public void setDecoderResult(DecoderResult decoderResult) {
84          this.decoderResult = decoderResult;
85      }
86  
87      @Override
88      public String toString() {
89          return "DefaultStompContent{" +
90              "decoderResult=" + decoderResult +
91              '}';
92      }
93  }