OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
BuiltinTopicKeyImpl.java
Go to the documentation of this file.
1 /*
2  * Vortex OpenSplice
3  *
4  * This software and documentation are Copyright 2006 to 2024 ADLINK
5  * Technology Limited, its affiliated companies and licensors. All rights
6  * reserved.
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 package org.opensplice.dds.topic;
22 
27 
28 public class BuiltinTopicKeyImpl implements BuiltinTopicKey {
29  private static final long serialVersionUID = 4755982116057745495L;
30  private final transient OsplServiceEnvironment environment;
31  private int[] value;
32 
33  public BuiltinTopicKeyImpl(OsplServiceEnvironment environment, int[] value) {
34  this.environment = environment;
35 
36  if (value == null) {
37  throw new IllegalArgumentExceptionImpl(this.environment,
38  "Invalid BuiltinTopicKey provided.");
39  }
40  this.value = new int[value.length];
41  System.arraycopy(value, 0, this.value, 0, value.length);
42  }
43 
44  @Override
46  return this.environment;
47  }
48 
49  @Override
50  public int[] getValue() {
51  int[] result = new int[this.value.length];
52  System.arraycopy(this.value, 0, result, 0, this.value.length);
53  return result;
54  }
55 
56  @Override
57  public void copyFrom(BuiltinTopicKey src) {
58  if (src == null) {
59  throw new IllegalArgumentExceptionImpl(this.environment,
60  "Illegal BuiltinTopicKey (null) provided.");
61  }
62  this.value = src.getValue();
63  }
64 
65  @Override
67  return new BuiltinTopicKeyImpl(this.environment, this.value);
68  }
69 }
int [] getValue()
Get a copy of the value.
int [] getValue()
Get a copy of the value.
void copyFrom(BuiltinTopicKey src)
Overwrite the state of this object with that of the given object.
BuiltinTopicKeyImpl(OsplServiceEnvironment environment, int[] value)
DDS implementations are rooted in this class, a concrete subclass of which can be instantiated based ...