package org.apereo.cas.authentication.metadata;

import org.apereo.cas.authentication.Credential;
import org.apereo.cas.authentication.CredentialMetaData;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.EqualsAndHashCode;
import lombok.Getter;

/**
 * Basic credential metadata implementation that stores the original credential ID and the original credential type.
 * This can be used as a simple converter for any {@link Credential} that doesn't implement {@link CredentialMetaData}.
 *
 * @author Marvin S. Addison
 * @since 4.0.0
 */
@Getter
@EqualsAndHashCode
public class BasicCredentialMetaData implements CredentialMetaData {

    /**
     * Serialization version marker.
     */
    private static final long serialVersionUID = 4929579849241505377L;

    private final Credential credential;

    @JsonCreator
    public BasicCredentialMetaData(final Credential credential) {
        this.credential = credential;
    }

    @JsonIgnore
    @Override
    public String getId() {
        return this.credential.getId();
    }

    @JsonIgnore
    @Override
    public Class<? extends Credential> getCredentialClass() {
        return this.credential.getClass();
    }
}

@@ -308,16 +308,71 @@
 .Getter;
+%0Aimport lombok.NoArgsConstructor;%0Aimport lombok.Setter;
 %0A%0A/**%0A *
@@ -666,16 +666,43 @@
 @Getter%0A
+@Setter%0A@NoArgsConstructor%0A
 @EqualsA
@@ -919,22 +919,16 @@
 private 
-final 
 Credenti
@@ -947,135 +947,8 @@
 l;%0A%0A
-    @JsonCreator%0A    public BasicCredentialMetaData(final Credential credential) %7B%0A        this.credential = credential;%0A    %7D%0A
 %0A   

fix tests