Skip to content

Commit

Permalink
Auto-format code
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 27, 2024
1 parent ead08bf commit d2e39ec
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 37 deletions.
64 changes: 33 additions & 31 deletions server/src/main/java/edu/sjsu/moth/generated/StatusEdit.java
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@

// THIS FILE WAS GENERATED BY JSON2JAVA
// IT HAS NOT BEEN CHANGED. (IF IT HAS REMOVE THIS LINE)
// CHANGES MADE:
// * NONE SO FAR


package edu.sjsu.moth.generated;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import edu.sjsu.moth.server.db.Account;

@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"content",
"spoiler_text",
"sensitive",
"created_at",
"account",
"media_attachments",
"emojis"
})
@JsonPropertyOrder({ "content", "spoiler_text", "sensitive", "created_at", "account", "media_attachments", "emojis" })
public class StatusEdit {

@JsonProperty("content")
Expand All @@ -43,12 +34,12 @@ public class StatusEdit {

/**
* No args constructor for use in serialization
*
*/
public StatusEdit() {
}

public StatusEdit(String content, String spoilerText, Boolean sensitive, String createdAt, Account account, List<MediaAttachment> mediaAttachments, List<CustomEmoji> emojis) {
public StatusEdit(String content, String spoilerText, Boolean sensitive, String createdAt, Account account,
List<MediaAttachment> mediaAttachments, List<CustomEmoji> emojis) {
super();
this.content = content;
this.spoilerText = spoilerText;
Expand All @@ -62,37 +53,38 @@ public StatusEdit(String content, String spoilerText, Boolean sensitive, String
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(StatusEdit.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append(StatusEdit.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this)))
.append('[');
sb.append("content");
sb.append('=');
sb.append(((this.content == null)?"<null>":this.content));
sb.append(((this.content == null) ? "<null>" : this.content));
sb.append(',');
sb.append("spoilerText");
sb.append('=');
sb.append(((this.spoilerText == null)?"<null>":this.spoilerText));
sb.append(((this.spoilerText == null) ? "<null>" : this.spoilerText));
sb.append(',');
sb.append("sensitive");
sb.append('=');
sb.append(((this.sensitive == null)?"<null>":this.sensitive));
sb.append(((this.sensitive == null) ? "<null>" : this.sensitive));
sb.append(',');
sb.append("createdAt");
sb.append('=');
sb.append(((this.createdAt == null)?"<null>":this.createdAt));
sb.append(((this.createdAt == null) ? "<null>" : this.createdAt));
sb.append(',');
sb.append("account");
sb.append('=');
sb.append(((this.account == null)?"<null>":this.account));
sb.append(((this.account == null) ? "<null>" : this.account));
sb.append(',');
sb.append("mediaAttachments");
sb.append('=');
sb.append(((this.mediaAttachments == null)?"<null>":this.mediaAttachments));
sb.append(((this.mediaAttachments == null) ? "<null>" : this.mediaAttachments));
sb.append(',');
sb.append("emojis");
sb.append('=');
sb.append(((this.emojis == null)?"<null>":this.emojis));
sb.append(((this.emojis == null) ? "<null>" : this.emojis));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
if (sb.charAt((sb.length() - 1)) == ',') {
sb.setCharAt((sb.length() - 1), ']');
} else {
sb.append(']');
}
Expand All @@ -102,13 +94,13 @@ public String toString() {
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.emojis == null)? 0 :this.emojis.hashCode()));
result = ((result* 31)+((this.createdAt == null)? 0 :this.createdAt.hashCode()));
result = ((result* 31)+((this.spoilerText == null)? 0 :this.spoilerText.hashCode()));
result = ((result* 31)+((this.mediaAttachments == null)? 0 :this.mediaAttachments.hashCode()));
result = ((result* 31)+((this.sensitive == null)? 0 :this.sensitive.hashCode()));
result = ((result* 31)+((this.content == null)? 0 :this.content.hashCode()));
result = ((result* 31)+((this.account == null)? 0 :this.account.hashCode()));
result = ((result * 31) + ((this.emojis == null) ? 0 : this.emojis.hashCode()));
result = ((result * 31) + ((this.createdAt == null) ? 0 : this.createdAt.hashCode()));
result = ((result * 31) + ((this.spoilerText == null) ? 0 : this.spoilerText.hashCode()));
result = ((result * 31) + ((this.mediaAttachments == null) ? 0 : this.mediaAttachments.hashCode()));
result = ((result * 31) + ((this.sensitive == null) ? 0 : this.sensitive.hashCode()));
result = ((result * 31) + ((this.content == null) ? 0 : this.content.hashCode()));
result = ((result * 31) + ((this.account == null) ? 0 : this.account.hashCode()));
return result;
}

Expand All @@ -121,7 +113,17 @@ public boolean equals(Object other) {
return false;
}
StatusEdit rhs = ((StatusEdit) other);
return ((((((((this.emojis == rhs.emojis)||((this.emojis!= null)&&this.emojis.equals(rhs.emojis)))&&((this.createdAt == rhs.createdAt)||((this.createdAt!= null)&&this.createdAt.equals(rhs.createdAt))))&&((this.spoilerText == rhs.spoilerText)||((this.spoilerText!= null)&&this.spoilerText.equals(rhs.spoilerText))))&&((this.mediaAttachments == rhs.mediaAttachments)||((this.mediaAttachments!= null)&&this.mediaAttachments.equals(rhs.mediaAttachments))))&&((this.sensitive == rhs.sensitive)||((this.sensitive!= null)&&this.sensitive.equals(rhs.sensitive))))&&((this.content == rhs.content)||((this.content!= null)&&this.content.equals(rhs.content))))&&((this.account == rhs.account)||((this.account!= null)&&this.account.equals(rhs.account))));
return ((((((((this.emojis == rhs.emojis) || ((this.emojis != null) && this.emojis.equals(rhs.emojis))) &&
((this.createdAt == rhs.createdAt) ||
((this.createdAt != null) && this.createdAt.equals(rhs.createdAt)))) &&
((this.spoilerText == rhs.spoilerText) ||
((this.spoilerText != null) && this.spoilerText.equals(rhs.spoilerText)))) &&
((this.mediaAttachments == rhs.mediaAttachments) ||
((this.mediaAttachments != null) && this.mediaAttachments.equals(rhs.mediaAttachments)))) &&
((this.sensitive == rhs.sensitive) ||
((this.sensitive != null) && this.sensitive.equals(rhs.sensitive)))) &&
((this.content == rhs.content) || ((this.content != null) && this.content.equals(rhs.content)))) &&
((this.account == rhs.account) || ((this.account != null) && this.account.equals(rhs.account))));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public StatusEditCollection(String id, ArrayList<StatusEdit> collection) {
}

public StatusEditCollection addEdit(Status s) {
StatusEdit edit = new StatusEdit(s.content, s.spoilerText, s.sensitive, s.createdAt, s.account, s.mediaAttachments, s.emojis);
StatusEdit edit =
new StatusEdit(s.content, s.spoilerText, s.sensitive, s.createdAt, s.account, s.mediaAttachments,
s.emojis);
collection.add(edit);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
import org.springframework.data.mongodb.repository.ReactiveMongoRepository;
import org.springframework.data.querydsl.ReactiveQuerydslPredicateExecutor;

public interface StatusHistoryRepository
extends ReactiveMongoRepository<StatusEditCollection, String>, ReactiveQuerydslPredicateExecutor<StatusEditCollection> {
}
public interface StatusHistoryRepository extends ReactiveMongoRepository<StatusEditCollection, String>,
ReactiveQuerydslPredicateExecutor<StatusEditCollection> {}
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ public Mono<Status> save(Status status) {
}));
}

return mono.then(statusRepository.save(status))
.flatMap(s -> statusHistoryRepository.findById(s.id).defaultIfEmpty(new StatusEditCollection(s.id))
return mono.then(statusRepository.save(status)).flatMap(
s -> statusHistoryRepository.findById(s.id).defaultIfEmpty(new StatusEditCollection(s.id))
.flatMap(sh -> statusHistoryRepository.save(sh.addEdit(s))).thenReturn(s));
}

Expand Down

0 comments on commit d2e39ec

Please sign in to comment.