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

io.sphere.sdk.orders.SyncInfo Maven / Gradle / Ivy

There is a newer version: 1.0.0-M26
Show newest version
package io.sphere.sdk.orders;

import com.fasterxml.jackson.annotation.JsonCreator;
import io.sphere.sdk.channels.Channel;
import io.sphere.sdk.models.Base;
import io.sphere.sdk.models.Reference;
import io.sphere.sdk.models.Referenceable;

import javax.annotation.Nullable;
import java.time.ZonedDateTime;

public class SyncInfo extends Base {
    private final Reference channel;
    @Nullable
    private final String externalId;
    private final ZonedDateTime syncedAt;

    @JsonCreator
    private SyncInfo(final Reference channel, final ZonedDateTime syncedAt, @Nullable final String externalId) {
        this.channel = channel;
        this.externalId = externalId;
        this.syncedAt = syncedAt;
    }

    public static SyncInfo of(final Referenceable channel, final ZonedDateTime syncedAt, @Nullable final String externalId) {
        return new SyncInfo(channel.toReference(), syncedAt, externalId);

    }

    public Reference getChannel() {
        return channel;
    }

    @Nullable
    public String getExternalId() {
        return externalId;
    }

    public ZonedDateTime getSyncedAt() {
        return syncedAt;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy