View Javadoc
1   /*
2    * Copyright 2016 The Lannister Project
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * 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,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package net.anyflow.lannister.cluster;
17  
18  import java.util.stream.Stream;
19  
20  import com.google.common.collect.Sets;
21  
22  public class NativeSet<V> implements Set<V> {
23  	private final java.util.Set<V> engine;
24  
25  	protected NativeSet() {
26  		engine = Sets.newHashSet();
27  	}
28  
29  	@Override
30  	public Stream<V> stream() {
31  		return engine.stream();
32  	}
33  
34  	@Override
35  	public boolean remove(V value) {
36  		return engine.remove(value);
37  	}
38  
39  	@Override
40  	public boolean add(V value) {
41  		return engine.add(value);
42  	}
43  
44  	@Override
45  	public void dispose() {
46  		// DO NOTHING
47  	}
48  }