Refactor and cleanup

This commit is contained in:
crschnick
2023-06-16 03:38:39 +00:00
parent 6af56c451a
commit 0274ade547
299 changed files with 1634 additions and 1335 deletions

View File

@@ -98,14 +98,14 @@ public interface DataSource {
/**
* Wrapper for {@link #create(DataSourceId, String, InputStream)} that creates an anonymous data source.
*/
public static DataSource createAnonymous(String type, Path path) {
static DataSource createAnonymous(String type, Path path) {
return create(null, type, path);
}
/**
* Wrapper for {@link #create(DataSourceId, String, InputStream)}.
*/
public static DataSource create(DataSourceId id, String type, Path path) {
static DataSource create(DataSourceId id, String type, Path path) {
try (var in = Files.newInputStream(path)) {
return create(id, type, in);
} catch (IOException e) {
@@ -116,14 +116,14 @@ public interface DataSource {
/**
* Wrapper for {@link #create(DataSourceId, String, InputStream)} that creates an anonymous data source.
*/
public static DataSource createAnonymous(String type, URL url) {
static DataSource createAnonymous(String type, URL url) {
return create(null, type, url);
}
/**
* Wrapper for {@link #create(DataSourceId, String, InputStream)}.
*/
public static DataSource create(DataSourceId id, String type, URL url) {
static DataSource create(DataSourceId id, String type, URL url) {
try (var in = url.openStream()) {
return create(id, type, in);
} catch (IOException e) {
@@ -134,7 +134,7 @@ public interface DataSource {
/**
* Wrapper for {@link #create(DataSourceId, String, InputStream)} that creates an anonymous data source.
*/
public static DataSource createAnonymous(String type, InputStream in) {
static DataSource createAnonymous(String type, InputStream in) {
return create(null, type, in);
}
@@ -146,7 +146,7 @@ public interface DataSource {
* @param in the input stream to read
* @return a {@link DataSource} instances that can be used to access the underlying data
*/
public static DataSource create(DataSourceId id, String type, InputStream in) {
static DataSource create(DataSourceId id, String type, InputStream in) {
return DataSourceImpl.create(id, type, in);
}
@@ -156,7 +156,7 @@ public interface DataSource {
* @param id the data source id
* @return a {@link DataSource} instances that can be used to access the underlying data
*/
public static DataSource create(DataSourceId id, io.xpipe.core.source.DataSource<?> source) {
static DataSource create(DataSourceId id, io.xpipe.core.source.DataSource<?> source) {
return DataSourceImpl.create(id, source);
}
@@ -169,7 +169,7 @@ public interface DataSource {
* @param in the data store to add
* @return a {@link DataSource} instances that can be used to access the underlying data
*/
public static DataSource create(DataSourceId id, String type, DataStore in) {
static DataSource create(DataSourceId id, String type, DataStore in) {
return DataSourceImpl.create(id, type, in);
}
@@ -177,7 +177,7 @@ public interface DataSource {
void appendTo(DataSource target);
public io.xpipe.core.source.DataSource<?> getInternalSource();
io.xpipe.core.source.DataSource<?> getInternalSource();
/**
* Returns the id of this data source.

View File

@@ -15,7 +15,7 @@ import io.xpipe.core.source.DataSourceId;
*/
public interface DataTableAccumulator {
public static DataTableAccumulator create(TupleType type) {
static DataTableAccumulator create(TupleType type) {
return new DataTableAccumulatorImpl(type);
}

View File

@@ -137,14 +137,14 @@ public final class XPipeApiConnection extends BeaconConnection {
}
@FunctionalInterface
public static interface Handler {
public interface Handler {
void handle(BeaconConnection con) throws Exception;
void handle(BeaconConnection con);
}
@FunctionalInterface
public static interface Mapper<T> {
public interface Mapper<T> {
T handle(BeaconConnection con) throws Exception;
T handle(BeaconConnection con);
}
}

View File

@@ -28,9 +28,9 @@ public class DataTableAccumulatorImpl implements DataTableAccumulator {
private final XPipeApiConnection connection;
private final TupleType type;
private int rows;
private InternalStreamStore store;
private final InternalStreamStore store;
private TupleType writtenDescriptor;
private OutputStream bodyOutput;
private final OutputStream bodyOutput;
public DataTableAccumulatorImpl(TupleType type) {
this.type = type;

View File

@@ -70,7 +70,6 @@ public class DataTableImpl extends DataSourceImpl implements DataTable {
public Iterator<TupleNode> iterator() {
return new TableIterator();
}
;
private class TableIterator implements Iterator<TupleNode> {