Adopt compile-time Lombok for shared and host boilerplate
This commit is contained in:
@@ -7,6 +7,8 @@ import java.nio.file.*;
|
||||
import java.time.*;
|
||||
import java.util.*;
|
||||
import java.util.function.BooleanSupplier;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Atomic private copies with persistent last-successful state and cross-process eviction leases.
|
||||
@@ -234,19 +236,13 @@ public final class SnapshotStore {
|
||||
sources.put(source, before);
|
||||
}
|
||||
|
||||
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
public final class Lease implements AutoCloseable {
|
||||
private final Snapshot snapshot;
|
||||
private final Path ticket;
|
||||
private final FileChannel channel;
|
||||
private final FileLock lock;
|
||||
|
||||
private Lease(Snapshot snapshot, Path ticket, FileChannel channel, FileLock lock) {
|
||||
this.snapshot = snapshot;
|
||||
this.ticket = ticket;
|
||||
this.channel = channel;
|
||||
this.lock = lock;
|
||||
}
|
||||
|
||||
public Snapshot snapshot() {
|
||||
return snapshot;
|
||||
}
|
||||
|
||||
@@ -2,11 +2,13 @@ package de.neitzel.fxdesigner.generation;
|
||||
|
||||
import de.neitzel.fxdesigner.protocol.BindingMetadata;
|
||||
import java.util.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/** Pure, deterministic form proposals. Target discovery validates the resulting document. */
|
||||
public final class ViewGeneration {
|
||||
private ViewGeneration() {}
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public enum Control {
|
||||
TextField("text"),
|
||||
Label("text"),
|
||||
@@ -17,10 +19,6 @@ public final class ViewGeneration {
|
||||
Table("");
|
||||
private final String property;
|
||||
|
||||
Control(String property) {
|
||||
this.property = property;
|
||||
}
|
||||
|
||||
public String property() {
|
||||
return property;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package de.neitzel.fxdesigner.workflow;
|
||||
|
||||
import java.util.concurrent.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/** One retained resource, one running operation and one replaceable pending operation. */
|
||||
@RequiredArgsConstructor
|
||||
public final class LatestSession<R extends AutoCloseable> implements AutoCloseable {
|
||||
public interface Factory<R> {
|
||||
R open() throws Exception;
|
||||
@@ -25,10 +27,6 @@ public final class LatestSession<R extends AutoCloseable> implements AutoCloseab
|
||||
this(value -> true);
|
||||
}
|
||||
|
||||
public LatestSession(java.util.function.Predicate<R> healthy) {
|
||||
this.healthy = healthy;
|
||||
}
|
||||
|
||||
private Job<R, ?> pending;
|
||||
private R resource;
|
||||
private Object resourceKey;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package de.neitzel.fxdesigner.workflow;
|
||||
|
||||
import static de.neitzel.fxdesigner.protocol.WireProtocol.*;
|
||||
|
||||
import de.neitzel.fxdesigner.config.DesignerConfiguration;
|
||||
import de.neitzel.fxdesigner.protocol.*;
|
||||
import java.io.*;
|
||||
@@ -11,10 +10,12 @@ import java.time.*;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.function.Consumer;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* One target process, authenticated socket and reserved owner pipe. All blocking calls run off UI.
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public final class PreviewWorker implements AutoCloseable {
|
||||
private final DraftOverlay overlay;
|
||||
private Process process;
|
||||
@@ -23,10 +24,6 @@ public final class PreviewWorker implements AutoCloseable {
|
||||
private ProtocolSession protocol;
|
||||
private volatile boolean closed;
|
||||
|
||||
public PreviewWorker(DraftOverlay overlay) {
|
||||
this.overlay = overlay;
|
||||
}
|
||||
|
||||
public synchronized boolean healthy() {
|
||||
return !closed && (process == null || process.isAlive());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user