liquibase.logging.mdc.customobjects.MdcChangesetExtended Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of liquibase-core Show documentation
Show all versions of liquibase-core Show documentation
Liquibase is a tool for managing and executing database changes.
package liquibase.logging.mdc.customobjects;
import liquibase.changelog.ChangeSet;
import lombok.Getter;
import lombok.Setter;
import java.util.Objects;
@Getter
@Setter
public class MdcChangesetExtended extends MdcChangeset {
private String deploymentId;
private String changesetOutcome;
public MdcChangesetExtended(String changesetId, String changesetAuthor, String changesetFilepath, String deploymentId, String changesetOutcome) {
super(changesetId, changesetAuthor, changesetFilepath);
this.deploymentId = deploymentId;
this.changesetOutcome = changesetOutcome;
}
public static MdcChangesetExtended fromChangeset(ChangeSet changeSet) {
return new MdcChangesetExtended(
changeSet.getId(),
changeSet.getAuthor(),
changeSet.getFilePath(),
Objects.toString(changeSet.getAttribute("deploymentId")),
Objects.toString(changeSet.getAttribute("updateExecType")));
}
}