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-M12
Show newest version
package io.sphere.sdk.orders;

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 java.time.Instant;
import java.util.Optional;

public class SyncInfo extends Base {
    private final Reference channel;
    private final Optional externalId;
    private final Instant syncedAt;

    private SyncInfo(final Reference channel, final Instant syncedAt, final Optional externalId) {
        this.channel = channel;
        this.externalId = externalId;
        this.syncedAt = syncedAt;
    }

    public static SyncInfo of(final Referenceable channel, final Instant syncedAt, final Optional externalId) {
        return new SyncInfo(channel.toReference(), syncedAt, externalId);

    }

    public Reference getChannel() {
        return channel;
    }

    public Optional getExternalId() {
        return externalId;
    }

    public Instant getSyncedAt() {
        return syncedAt;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy