package org.cobbzilla.sendgrid;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.cobbzilla.util.reflect.ReflectionUtil;
import org.cobbzilla.util.string.StringUtil;

@Accessors(chain=true) @NoArgsConstructor
@EqualsAndHashCode(of="username")
@JsonIgnoreProperties(ignoreUnknown=true)
public class SendGridUser {

    public SendGridUser(SendGridJsonUser user) { ReflectionUtil.copy(this, user.getCredential()); }

    @Getter @Setter private long id;

    @Getter @Setter private String created_at;
    @Getter @Setter private String updated_at;
    @Getter @Setter private String pw_updated_at;

    @JsonIgnore @Getter @Setter private String username;

    @Getter @Setter private String password;
    public boolean hasPassword() { return !StringUtil.empty(password); }

    // it's called "name" in the JSON responses, but username in requests
    public String getName () { return getUsername(); }
    public SendGridUser setName (String name) { setUsername(name); return this; }

    @Getter @Setter private SendGridPermissions permissions;
}

@@ -288,16 +288,63 @@
 essors;%0A
+import org.cobbzilla.util.daemon.ZillaRuntime;%0A
 import o
@@ -385,23 +385,31 @@
 onUtil;%0A
+%0A
 import 
+static 
 org.cobb
@@ -423,25 +423,33 @@
 til.
-string.StringUtil
+daemon.ZillaRuntime.empty
 ;%0A%0A@
@@ -1028,19 +1028,8 @@
 rn !
-StringUtil.
 empt

move 'empty' from StringUtil to ZillaRuntime