com.almworks.jira.structure.api.sync.SyncDirection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of structure-api Show documentation
Show all versions of structure-api Show documentation
Public API for the Structure Plugin for JIRA
package com.almworks.jira.structure.api.sync;
import com.atlassian.annotations.PublicApi;
/**
* Defines two possible directions for the full synchronization.
*
* INBOUND
direction means the data is taken from issues or external system
* and applied to structure.
*
* OUTBOUND
direction means the data is taken from structure and applied
* to issues or to external system.
*
* @author Igor Sereda
*/
@PublicApi
public enum SyncDirection {
/**
* INBOUND
direction means the data is taken from issues or external system
* and applied to structure.
*/
INBOUND,
/**
* OUTBOUND
direction means the data is taken from structure and applied
* to issues or to external system.
*/
OUTBOUND;
public static final String CODE_OUTBOUND = "OUT";
public static final String CODE_INBOUND = "IN";
public static String getCode(SyncDirection direction) {
if (direction == null) return "null";
switch (direction) {
case INBOUND: return CODE_INBOUND;
case OUTBOUND: return CODE_OUTBOUND;
}
throw new IllegalArgumentException(direction.toString());
}
public static SyncDirection fromCode(String code) {
if (code == null || "null".equals(code)) return null;
switch (code) {
case CODE_INBOUND: return INBOUND;
case CODE_OUTBOUND: return OUTBOUND;
}
throw new IllegalArgumentException(code);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy