View Javadoc
1   /*
2    * Copyright 2013 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  
17  package io.netty.handler.codec.memcache;
18  
19  import io.netty.buffer.ByteBuf;
20  import io.netty.buffer.Unpooled;
21  import io.netty.util.internal.UnstableApi;
22  
23  /**
24   * The default implementation for the {@link LastMemcacheContent}.
25   */
26  @UnstableApi
27  public class DefaultLastMemcacheContent extends DefaultMemcacheContent implements LastMemcacheContent {
28  
29      public DefaultLastMemcacheContent() {
30          super(Unpooled.buffer());
31      }
32  
33      public DefaultLastMemcacheContent(ByteBuf content) {
34          super(content);
35      }
36  
37      @Override
38      public LastMemcacheContent retain() {
39          super.retain();
40          return this;
41      }
42  
43      @Override
44      public LastMemcacheContent retain(int increment) {
45          super.retain(increment);
46          return this;
47      }
48  
49      @Override
50      public LastMemcacheContent touch() {
51          super.touch();
52          return this;
53      }
54  
55      @Override
56      public LastMemcacheContent touch(Object hint) {
57          super.touch(hint);
58          return this;
59      }
60  
61      @Override
62      public LastMemcacheContent copy() {
63          return replace(content().copy());
64      }
65  
66      @Override
67      public LastMemcacheContent duplicate() {
68          return replace(content().duplicate());
69      }
70  
71      @Override
72      public LastMemcacheContent retainedDuplicate() {
73          return replace(content().retainedDuplicate());
74      }
75  
76      @Override
77      public LastMemcacheContent replace(ByteBuf content) {
78          return new DefaultLastMemcacheContent(content);
79      }
80  }