View Javadoc
1   /*
2    * Copyright 2016 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    *   http://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.smtp;
17  
18  import io.netty.buffer.ByteBuf;
19  import io.netty.buffer.DefaultByteBufHolder;
20  import io.netty.util.internal.UnstableApi;
21  
22  /**
23   * Default implementation of {@link SmtpContent} that does no validation of the raw data passed in.
24   */
25  @UnstableApi
26  public class DefaultSmtpContent extends DefaultByteBufHolder implements SmtpContent {
27  
28      /**
29       * Creates a new instance using the given data.
30       */
31      public DefaultSmtpContent(ByteBuf data) {
32          super(data);
33      }
34  
35      @Override
36      public SmtpContent copy() {
37          return (SmtpContent) super.copy();
38      }
39  
40      @Override
41      public SmtpContent duplicate() {
42          return (SmtpContent) super.duplicate();
43      }
44  
45      @Override
46      public SmtpContent retainedDuplicate() {
47          return (SmtpContent) super.retainedDuplicate();
48      }
49  
50      @Override
51      public SmtpContent replace(ByteBuf content) {
52          return new DefaultSmtpContent(content);
53      }
54  
55      @Override
56      public SmtpContent retain() {
57          super.retain();
58          return this;
59      }
60  
61      @Override
62      public SmtpContent retain(int increment) {
63          super.retain(increment);
64          return this;
65      }
66  
67      @Override
68      public SmtpContent touch() {
69          super.touch();
70          return this;
71      }
72  
73      @Override
74      public SmtpContent touch(Object hint) {
75          super.touch(hint);
76          return this;
77      }
78  }