Skip to content

Commit 52048d9

Browse files
committed
Fix java visibility for API
1 parent e507231 commit 52048d9

File tree

4 files changed

+45
-8
lines changed

4 files changed

+45
-8
lines changed

src/main/java/at/favre/lib/bytes/AbstractBytes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/**
2525
* Base interface for bytes
2626
*/
27-
public interface AbstractBytes {
27+
interface AbstractBytes {
2828

2929
/**
3030
* Checks if instance is mutable

src/main/java/at/favre/lib/bytes/BytesTransformer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public interface BytesTransformer {
5353
*/
5454
final class BitWiseOperatorTransformer implements BytesTransformer {
5555

56-
enum Mode {
56+
public enum Mode {
5757
AND, OR, XOR
5858
}
5959

@@ -128,7 +128,7 @@ public boolean supportInPlaceTransformation() {
128128
* @see <a href="https://en.wikipedia.org/wiki/Bitwise_operation#Bit_shifts">Bit shifts</a>
129129
*/
130130
final class ShiftTransformer implements BytesTransformer {
131-
enum Type {
131+
public enum Type {
132132
LEFT_SHIFT, RIGHT_SHIFT
133133
}
134134

src/main/java/at/favre/lib/bytes/BytesTransformers.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public static BytesTransformer decompressGzip() {
112112
/**
113113
* Shuffles the internal byte array
114114
*/
115-
final static class ShuffleTransformer implements BytesTransformer {
115+
public final static class ShuffleTransformer implements BytesTransformer {
116116
private final Random random;
117117

118118
ShuffleTransformer(Random random) {
@@ -136,7 +136,7 @@ public boolean supportInPlaceTransformation() {
136136
/**
137137
* Sorts the internal byte array with given {@link java.util.Comparator}
138138
*/
139-
final static class SortTransformer implements BytesTransformer {
139+
public final static class SortTransformer implements BytesTransformer {
140140
private final Comparator<Byte> comparator;
141141

142142
SortTransformer() {
@@ -170,8 +170,8 @@ public boolean supportInPlaceTransformation() {
170170
/**
171171
* Adds or converts to arbitrary checksum
172172
*/
173-
final static class ChecksumTransformer implements BytesTransformer {
174-
enum Mode {
173+
public final static class ChecksumTransformer implements BytesTransformer {
174+
public enum Mode {
175175
/**
176176
* Appends checksum to given byte array
177177
*/
@@ -217,7 +217,7 @@ public boolean supportInPlaceTransformation() {
217217
/**
218218
* Byte compression with gzip
219219
*/
220-
final static class GzipCompressor implements BytesTransformer {
220+
public final static class GzipCompressor implements BytesTransformer {
221221
private final boolean compress;
222222

223223
GzipCompressor(boolean compress) {
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright 2017 Patrick Favre-Bulle
3+
*
4+
* Licensed to the Apache Software Foundation (ASF) under one
5+
* or more contributor license agreements. See the NOTICE file
6+
* distributed with this work for additional information
7+
* regarding copyright ownership. The ASF licenses this file
8+
* to you under the Apache License, Version 2.0 (the
9+
* "License"); you may not use this file except in compliance
10+
* with the License. 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,
15+
* software distributed under the License is distributed on an
16+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
* KIND, either express or implied. See the License for the
18+
* specific language governing permissions and limitations
19+
* under the License.
20+
*/
21+
22+
package at.favre.lib.bytes.otherPackage;
23+
24+
import at.favre.lib.bytes.BytesTransformers;
25+
import org.junit.Test;
26+
27+
import java.util.zip.CRC32;
28+
29+
import static at.favre.lib.bytes.BytesTransformers.ChecksumTransformer;
30+
import static org.junit.Assert.assertFalse;
31+
32+
public class BytesTransformTest {
33+
@Test
34+
public void testApiVisible() throws Exception {
35+
assertFalse(BytesTransformers.checksum(new CRC32(), ChecksumTransformer.Mode.TRANSFORM, 4).supportInPlaceTransformation());
36+
}
37+
}

0 commit comments

Comments
 (0)