Skip to content

Commit

Permalink
feat: allows to map members
Browse files Browse the repository at this point in the history
  • Loading branch information
aelamrani committed Dec 1, 2015
1 parent 182cb56 commit c0d711e
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 21 deletions.
31 changes: 23 additions & 8 deletions src/main/java/io/gravitee/repository/management/model/Api.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package io.gravitee.repository.management.model;

import java.util.Date;
import java.util.List;
import java.util.Objects;

/**
Expand Down Expand Up @@ -68,6 +69,8 @@ public class Api {
*/
private LifecycleState lifecycleState = LifecycleState.STOPPED;

private List<Membership> members;

public Date getCreatedAt() {
return createdAt;
}
Expand Down Expand Up @@ -140,6 +143,14 @@ public void setId(String id) {
this.id = id;
}

public List<Membership> getMembers() {
return members;
}

public void setMembers(List<Membership> members) {
this.members = members;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
Expand All @@ -154,14 +165,18 @@ public int hashCode() {
return Objects.hash(name, version);
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder("Api{");
sb.append("id='").append(id).append('\'');
sb.append("name='").append(name).append('\'');
sb.append(", version='").append(version).append('\'');
sb.append(", lifecycleState=").append(lifecycleState);
sb.append('}');
return sb.toString();
return "Api{" +
"id='" + id + '\'' +
", name='" + name + '\'' +
", description='" + description + '\'' +
", version='" + version + '\'' +
", definition='" + definition + '\'' +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
", visibility=" + visibility +
", lifecycleState=" + lifecycleState +
", members=" + members +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Membership {
/**
* The user name
*/
private String user;
private User user;

/**
* Creation date
Expand Down Expand Up @@ -66,11 +66,11 @@ public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}

public String getUser() {
public User getUser() {
return user;
}

public void setUser(String user) {
public void setUser(User user) {
this.user = user;
}
}
25 changes: 15 additions & 10 deletions src/main/java/io/gravitee/repository/management/model/Page.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ public class Page {

private String type;

private String title;

private String content;

private String lastContributor;
Expand Down Expand Up @@ -75,14 +73,6 @@ public void setType(String type) {
this.type = type;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getContent() {
return content;
}
Expand Down Expand Up @@ -151,4 +141,19 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(id);
}

public String toString() {
return "Page{" +
"id='" + id + '\'' +
", name='" + name + '\'' +
", type='" + type + '\'' +
", content='" + content + '\'' +
", lastContributor='" + lastContributor + '\'' +
", order=" + order +
", published=" + published +
", api='" + api + '\'' +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
'}';
}
}

0 comments on commit c0d711e

Please sign in to comment.