Skip to content

Commit

Permalink
[api] Allows cancel Input (#2805)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankfliu authored Oct 13, 2023
1 parent 458933c commit 2f4ebee
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions api/src/main/java/ai/djl/modality/Input.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,32 @@ public class Input {

protected Map<String, String> properties;
protected PairList<String, BytesSupplier> content;
private boolean cancelled;

/** Constructs a new {@code Input} instance. */
public Input() {
properties = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
content = new PairList<>();
}

/**
* Returns {@code true} if the input is cancelled.
*
* @return {@code true} if the input is cancelled.
*/
public boolean isCancelled() {
return cancelled;
}

/**
* Sets the cancelled status.
*
* @param cancelled the cancelled status
*/
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}

/**
* Returns the properties of the input.
*
Expand Down

0 comments on commit 2f4ebee

Please sign in to comment.