Skip to content

Commit f7709e5

Browse files
authored
Merge pull request #11 from gcarcassi/master
First implementation of the generic purpose client
2 parents 6a4dd77 + bb07d76 commit f7709e5

397 files changed

Lines changed: 32104 additions & 15924 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
target/
2+
nbproject/
23
pom.xml.tag
34
pom.xml.releaseBackup
45
pom.xml.versionsBackup

epics-util/HEADER.TXT

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Copyright (C) 2010-14 diirt developers. See COPYRIGHT.TXT
2-
All rights reserved. Use is subject to license terms. See LICENSE.TXT
1+
Copyright information and license terms for this software can be
2+
found in the file LICENSE.TXT included with the distribution.

epics-util/pom.xml

Lines changed: 83 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,83 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3-
<modelVersion>4.0.0</modelVersion>
4-
<version>1.0.0-SNAPSHOT</version>
5-
<groupId>org.epics</groupId>
6-
<artifactId>epics-util</artifactId>
7-
<name>org.epics.util</name>
8-
<description>Basic Java utility classes to be shared across projects until
9-
suitable replacements are available in the JDK.</description>
10-
<properties>
11-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12-
</properties>
13-
<build>
14-
<plugins>
15-
<plugin>
16-
<groupId>org.apache.maven.plugins</groupId>
17-
<artifactId>maven-compiler-plugin</artifactId>
18-
<version>3.6.2</version>
19-
<configuration>
20-
<source>1.8</source>
21-
<target>1.8</target>
22-
</configuration>
23-
</plugin>
24-
<plugin>
25-
<groupId>org.apache.maven.plugins</groupId>
26-
<artifactId>maven-source-plugin</artifactId>
27-
<version>3.0.1</version>
28-
<executions>
29-
<execution>
30-
<id>attach-sources</id>
31-
<goals>
32-
<goal>jar</goal>
33-
</goals>
34-
</execution>
35-
</executions>
36-
</plugin>
37-
<plugin>
38-
<groupId>org.apache.maven.plugins</groupId>
39-
<artifactId>maven-javadoc-plugin</artifactId>
40-
<version>2.10.4</version>
41-
<executions>
42-
<execution>
43-
<id>attach-javadocs</id>
44-
<goals>
45-
<goal>jar</goal>
46-
</goals>
47-
</execution>
48-
</executions>
49-
</plugin>
50-
</plugins>
51-
</build>
52-
<dependencies>
53-
<dependency>
54-
<groupId>junit</groupId>
55-
<artifactId>junit</artifactId>
56-
<version>4.12</version>
57-
<scope>test</scope>
58-
</dependency>
59-
<dependency>
60-
<groupId>org.mockito</groupId>
61-
<artifactId>mockito-all</artifactId>
62-
<version>1.10.19</version>
63-
<scope>test</scope>
64-
</dependency>
65-
<dependency>
66-
<groupId>org.hamcrest</groupId>
67-
<artifactId>hamcrest-all</artifactId>
68-
<version>1.3</version>
69-
<scope>test</scope>
70-
</dependency>
71-
</dependencies>
72-
</project>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<version>1.0.0-SNAPSHOT</version>
5+
<groupId>org.epics</groupId>
6+
<artifactId>epics-util</artifactId>
7+
<name>org.epics.util</name>
8+
<description>Basic Java utility classes to be shared across projects until
9+
suitable replacements are available in the JDK.</description>
10+
<properties>
11+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
12+
</properties>
13+
<build>
14+
<plugins>
15+
<plugin>
16+
<groupId>org.apache.maven.plugins</groupId>
17+
<artifactId>maven-compiler-plugin</artifactId>
18+
<version>3.6.2</version>
19+
<configuration>
20+
<source>1.8</source>
21+
<target>1.8</target>
22+
</configuration>
23+
</plugin>
24+
<plugin>
25+
<groupId>org.apache.maven.plugins</groupId>
26+
<artifactId>maven-source-plugin</artifactId>
27+
<version>3.0.1</version>
28+
<executions>
29+
<execution>
30+
<id>attach-sources</id>
31+
<goals>
32+
<goal>jar</goal>
33+
</goals>
34+
</execution>
35+
</executions>
36+
</plugin>
37+
<plugin>
38+
<groupId>org.apache.maven.plugins</groupId>
39+
<artifactId>maven-javadoc-plugin</artifactId>
40+
<version>2.10.4</version>
41+
<executions>
42+
<execution>
43+
<id>attach-javadocs</id>
44+
<goals>
45+
<goal>jar</goal>
46+
</goals>
47+
</execution>
48+
</executions>
49+
</plugin>
50+
<plugin>
51+
<groupId>com.mycila</groupId>
52+
<artifactId>license-maven-plugin</artifactId>
53+
<version>3.0</version>
54+
<configuration>
55+
<header>HEADER.TXT</header>
56+
<includes>
57+
<include>**/*.java</include>
58+
</includes>
59+
</configuration>
60+
</plugin>
61+
</plugins>
62+
</build>
63+
<dependencies>
64+
<dependency>
65+
<groupId>junit</groupId>
66+
<artifactId>junit</artifactId>
67+
<version>4.12</version>
68+
<scope>test</scope>
69+
</dependency>
70+
<dependency>
71+
<groupId>org.mockito</groupId>
72+
<artifactId>mockito-all</artifactId>
73+
<version>1.10.19</version>
74+
<scope>test</scope>
75+
</dependency>
76+
<dependency>
77+
<groupId>org.hamcrest</groupId>
78+
<artifactId>hamcrest-all</artifactId>
79+
<version>1.3</version>
80+
<scope>test</scope>
81+
</dependency>
82+
</dependencies>
83+
</project>
Lines changed: 84 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,84 @@
1-
/**
2-
* Copyright (C) 2010-14 diirt developers. See COPYRIGHT.TXT
3-
* All rights reserved. Use is subject to license terms. See LICENSE.TXT
4-
*/
5-
package org.epics.util.array;
6-
7-
import java.io.Serializable;
8-
import java.util.Arrays;
9-
10-
/**
11-
* Wraps a {@code boolean[]} into a {@link ListBoolean}.
12-
*
13-
* @author Gabriele Carcassi
14-
*/
15-
public final class ArrayBoolean extends ListBoolean implements Serializable {
16-
17-
private static final long serialVersionUID = 7493025761455302915L;
18-
19-
private final boolean[] array;
20-
private final boolean readOnly;
21-
22-
/**
23-
* A new read-only {@code ArrayBoolean} that wraps around the given array.
24-
*
25-
* @param array an array
26-
*/
27-
public ArrayBoolean(boolean... array) {
28-
this(array, true);
29-
}
30-
31-
/**
32-
* A new {@code ArrayBoolean} that wraps around the given array.
33-
*
34-
* @param array an array
35-
* @param readOnly if false the wrapper allows writes to the array
36-
*/
37-
public ArrayBoolean(boolean[] array, boolean readOnly) {
38-
this.array = array;
39-
this.readOnly = readOnly;
40-
}
41-
42-
@Override
43-
public final int size() {
44-
return array.length;
45-
}
46-
47-
@Override
48-
public boolean getBoolean(int index) {
49-
return array[index];
50-
}
51-
52-
@Override
53-
public void setBoolean(int index, boolean value) {
54-
if (!readOnly) {
55-
array[index] = value;
56-
} else {
57-
throw new UnsupportedOperationException("Read only list.");
58-
}
59-
}
60-
61-
@Override
62-
public boolean equals(Object obj) {
63-
if (obj instanceof ArrayBoolean) {
64-
return Arrays.equals(array, ((ArrayBoolean) obj).array);
65-
}
66-
67-
return super.equals(obj);
68-
}
69-
70-
boolean[] wrappedArray() {
71-
return array;
72-
}
73-
74-
}
1+
/**
2+
* Copyright information and license terms for this software can be
3+
* found in the file LICENSE.TXT included with the distribution.
4+
*/
5+
package org.epics.util.array;
6+
7+
import java.io.Serializable;
8+
import java.util.Arrays;
9+
10+
/**
11+
* Wraps a {@code boolean[]} into a {@link ListBoolean}.
12+
*
13+
* @author Gabriele Carcassi
14+
*/
15+
public final class ArrayBoolean extends ListBoolean implements Serializable {
16+
17+
private static final long serialVersionUID = 7493025761455302915L;
18+
19+
private final boolean[] array;
20+
private final boolean readOnly;
21+
22+
/**
23+
* A new read-only {@code ArrayBoolean} that wraps around the given array.
24+
*
25+
* @param array an array
26+
*/
27+
public ArrayBoolean(boolean... array) {
28+
this(array, true);
29+
}
30+
31+
/**
32+
* A new {@code ArrayBoolean} that wraps around the given array.
33+
*
34+
* @param array an array
35+
* @param readOnly if false the wrapper allows writes to the array
36+
*/
37+
public ArrayBoolean(boolean[] array, boolean readOnly) {
38+
this.array = array;
39+
this.readOnly = readOnly;
40+
}
41+
42+
@Override
43+
public final int size() {
44+
return array.length;
45+
}
46+
47+
@Override
48+
public boolean getBoolean(int index) {
49+
return array[index];
50+
}
51+
52+
@Override
53+
public void setBoolean(int index, boolean value) {
54+
if (!readOnly) {
55+
array[index] = value;
56+
} else {
57+
throw new UnsupportedOperationException("Read only list.");
58+
}
59+
}
60+
61+
@Override
62+
public boolean equals(Object obj) {
63+
if (obj instanceof ArrayBoolean) {
64+
return Arrays.equals(array, ((ArrayBoolean) obj).array);
65+
}
66+
67+
return super.equals(obj);
68+
}
69+
70+
boolean[] wrappedArray() {
71+
return array;
72+
}
73+
74+
/**
75+
* Returns an unmodifiable {@link ArrayBoolean} wrapper for the given {@code boolean} array.
76+
*
77+
* @param values a primitive array.
78+
* @return an immutable wrapper.
79+
*/
80+
public static ArrayBoolean of(boolean... values) {
81+
return new ArrayBoolean(values);
82+
}
83+
84+
}

0 commit comments

Comments
 (0)