forked from fossasia/open-event-droidgen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: removed lombok from the project and added necessary methods…
… to the classes. Fixes fossasia#2371
- Loading branch information
Showing
40 changed files
with
3,584 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 107 additions & 5 deletions
112
android/app/src/main/java/org/fossasia/openevent/config/Config.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,122 @@ | ||
package org.fossasia.openevent.config; | ||
|
||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
/** | ||
* Config to be replaced in {@link org.fossasia.openevent.config.strategies.AppConfigStrategy} | ||
* | ||
* TODO: Add the correct JSON parsing mechanism and populate config in this format and share across project | ||
* | ||
* NOT IMPLEMENTED YET | ||
*/ | ||
@Data | ||
@Builder | ||
public class Config { | ||
private final String apiLink; | ||
private final String email; | ||
private final String appName; | ||
private final boolean authEnabled; | ||
|
||
Config(String apiLink, String email, String appName, boolean authEnabled) { | ||
this.apiLink = apiLink; | ||
this.email = email; | ||
this.appName = appName; | ||
this.authEnabled = authEnabled; | ||
} | ||
|
||
public static ConfigBuilder builder() { | ||
return new ConfigBuilder(); | ||
} | ||
|
||
public String getApiLink() { | ||
return this.apiLink; | ||
} | ||
|
||
public String getEmail() { | ||
return this.email; | ||
} | ||
|
||
public String getAppName() { | ||
return this.appName; | ||
} | ||
|
||
public boolean getAuthEnabled() { | ||
return this.authEnabled; | ||
} | ||
|
||
public boolean equals(Object o) { | ||
if (o == this) return true; | ||
if (!(o instanceof Config)) return false; | ||
final Config other = (Config) o; | ||
if (!other.canEqual((Object) this)) return false; | ||
final Object this$apiLink = this.getApiLink(); | ||
final Object other$apiLink = other.getApiLink(); | ||
if (this$apiLink == null ? other$apiLink != null : !this$apiLink.equals(other$apiLink)) | ||
return false; | ||
final Object this$email = this.getEmail(); | ||
final Object other$email = other.getEmail(); | ||
if (this$email == null ? other$email != null : !this$email.equals(other$email)) | ||
return false; | ||
final Object this$appName = this.getAppName(); | ||
final Object other$appName = other.getAppName(); | ||
if (this$appName == null ? other$appName != null : !this$appName.equals(other$appName)) | ||
return false; | ||
if (this.getAuthEnabled() != other.getAuthEnabled()) return false; | ||
return true; | ||
} | ||
|
||
public int hashCode() { | ||
final int PRIME = 59; | ||
int result = 1; | ||
final Object $apiLink = this.getApiLink(); | ||
result = result * PRIME + ($apiLink == null ? 43 : $apiLink.hashCode()); | ||
final Object $email = this.getEmail(); | ||
result = result * PRIME + ($email == null ? 43 : $email.hashCode()); | ||
final Object $appName = this.getAppName(); | ||
result = result * PRIME + ($appName == null ? 43 : $appName.hashCode()); | ||
result = result * PRIME + (this.getAuthEnabled() ? 79 : 97); | ||
return result; | ||
} | ||
|
||
protected boolean canEqual(Object other) { | ||
return other instanceof Config; | ||
} | ||
|
||
public String toString() { | ||
return "Config(apiLink=" + this.getApiLink() + ", email=" + this.getEmail() + ", appName=" + this.getAppName() + ", authEnabled=" + this.getAuthEnabled() + ")"; | ||
} | ||
|
||
public static class ConfigBuilder { | ||
private String apiLink; | ||
private String email; | ||
private String appName; | ||
private boolean authEnabled; | ||
|
||
ConfigBuilder() { | ||
} | ||
|
||
public Config.ConfigBuilder apiLink(String apiLink) { | ||
this.apiLink = apiLink; | ||
return this; | ||
} | ||
|
||
public Config.ConfigBuilder email(String email) { | ||
this.email = email; | ||
return this; | ||
} | ||
|
||
public Config.ConfigBuilder appName(String appName) { | ||
this.appName = appName; | ||
return this; | ||
} | ||
|
||
public Config.ConfigBuilder authEnabled(boolean authEnabled) { | ||
this.authEnabled = authEnabled; | ||
return this; | ||
} | ||
|
||
public Config build() { | ||
return new Config(apiLink, email, appName, authEnabled); | ||
} | ||
|
||
public String toString() { | ||
return "Config.ConfigBuilder(apiLink=" + this.apiLink + ", email=" + this.email + ", appName=" + this.appName + ", authEnabled=" + this.authEnabled + ")"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.