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

com.hp.autonomy.hod.client.api.developer.Authentication Maven / Gradle / Ivy

There is a newer version: 0.25.3
Show newest version
/*
 * Copyright 2015-2016 Hewlett-Packard Development Company, L.P.
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
 */

package com.hp.autonomy.hod.client.api.developer;

import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import lombok.Data;
import lombok.experimental.Accessors;
import org.joda.time.DateTime;

import java.util.UUID;

@Data
@JsonDeserialize(builder = Authentication.Builder.class)
public class Authentication {
    private final UUID uuid;
    private final ApplicationAuthMode mode;
    private final DateTime createdAt;
    private final boolean active;

    private Authentication(final Builder builder) {
        uuid = builder.uuid;
        mode = builder.mode;
        active = builder.active;
        createdAt = builder.createdAt;
    }

    @Data
    @Accessors(chain = true)
    @JsonPOJOBuilder(withPrefix = "set")
    public static class Builder {
        private UUID uuid;
        private ApplicationAuthMode mode;
        private boolean active;
        private DateTime createdAt;

        @JsonSetter
        public Builder setCreatedAt(final String createdAt) {
            this.createdAt = new DateTime(createdAt);
            return this;
        }

        public Builder setCreatedAt(final DateTime createdAt) {
            this.createdAt = createdAt;
            return this;
        }

        public Authentication build() {
            return new Authentication(this);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy