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