All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.gitlab4j.api.webhook.EventChanges Maven / Gradle / Ivy

Go to download

GitLab4J-API (gitlab4j-api) provides a full featured Java client library for working with GitLab repositories and servers via the GitLab REST API.

There is a newer version: 6.0.0-rc.6
Show newest version
package org.gitlab4j.api.webhook;

import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import org.gitlab4j.api.models.Assignee;
import org.gitlab4j.api.utils.JacksonJson;

public abstract class EventChanges {

    private ChangeContainer authorId;
    private ChangeContainer createdAt;
    private ChangeContainer updatedAt;
    private ChangeContainer updatedById;
    private ChangeContainer title;
    private ChangeContainer description;
    private ChangeContainer state;
    private ChangeContainer milestoneId;
    private ChangeContainer> labels;
    private ChangeContainer> assignees;
    private ChangeContainer totalTimeSpent;
    private Map> otherProperties = new LinkedHashMap<>();

    public ChangeContainer getAuthorId() {
        return authorId;
    }

    public void setAuthorId(ChangeContainer authorId) {
        this.authorId = authorId;
    }

    public ChangeContainer getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(ChangeContainer createdAt) {
        this.createdAt = createdAt;
    }

    public ChangeContainer getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(ChangeContainer updatedAt) {
        this.updatedAt = updatedAt;
    }

    public ChangeContainer getUpdatedById() {
        return updatedById;
    }

    public void setUpdatedById(ChangeContainer updatedById) {
        this.updatedById = updatedById;
    }

    public ChangeContainer getTitle() {
        return title;
    }

    public void setTitle(ChangeContainer title) {
        this.title = title;
    }

    public ChangeContainer getDescription() {
        return description;
    }

    public void setDescription(ChangeContainer description) {
        this.description = description;
    }

    public ChangeContainer getState() {
        return state;
    }

    public void setState(ChangeContainer state) {
        this.state = state;
    }

    public ChangeContainer getMilestoneId() {
        return milestoneId;
    }

    public void setMilestoneId(ChangeContainer milestoneId) {
        this.milestoneId = milestoneId;
    }

    public ChangeContainer> getLabels() {
        return labels;
    }

    public void setLabels(ChangeContainer> labels) {
        this.labels = labels;
    }

    public ChangeContainer> getAssignees() {
        return assignees;
    }

    public void setAssignees(ChangeContainer> assignees) {
        this.assignees = assignees;
    }

    public ChangeContainer getTotalTimeSpent() {
        return totalTimeSpent;
    }

    public void setTotalTimeSpent(ChangeContainer totalTimeSpent) {
        this.totalTimeSpent = totalTimeSpent;
    }

    @SuppressWarnings("unchecked")
    public  ChangeContainer get(String property){

        if(otherProperties.containsKey(property)){
            try {
                final ChangeContainer container = otherProperties.get(property);
                // noinspection unchecked :  It's duty from caller to be sure to do that
                return container != null ? (ChangeContainer) container : null;
            } catch (ClassCastException e) {
                return null;
            }
        } else {
            return null;
        }
    }

    @JsonAnyGetter
    public Map> any() {
        return this.otherProperties;
    }

    @JsonAnySetter
    public void set(String name, ChangeContainer value) {
        otherProperties.put(name, value);
    }

    @Override
    public String toString() {
        return (JacksonJson.toJsonString(this));
    }
}