Skip to content
This repository has been archived by the owner on Oct 23, 2019. It is now read-only.

[WIP]Feat/local database #168

Open
wants to merge 8 commits into
base: feat/API_client
Choose a base branch
from
Open

Conversation

hso132
Copy link
Collaborator

@hso132 hso132 commented Dec 16, 2018

No description provided.

@hso132 hso132 changed the base branch from master to feat/API_client December 16, 2018 15:11
@roosemberth roosemberth force-pushed the feat/API_client branch 9 times, most recently from d65ea3f to ad5860b Compare December 17, 2018 10:42
import ch.epfl.sweng.erpa.database.converter.*;
import ch.epfl.sweng.erpa.model.*;

@Database(entities = {Game.class, PlayerJoinGameRequest.class, UserAuth.class, Username.class, UserProfile.class, UserSessionToken.class}, version = 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please restructure into -140 character lines?

}


private static final BiMap<Integer, PlayerJoinGameRequest.RequestStatus> requestStatusConversionMap = genRequestStatusConversionMap();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use @Getter(lazy=true)


/**
* Builds a conversion map for the RequestStatus enum
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superfluous comments, this is simple enough to be understood from the reference name.

result.put(10, Game.Difficulty.NOOB);
result.put(20, Game.Difficulty.CHILL);
result.put(30, Game.Difficulty.HARD);
assert conversionMapHasAll(result, Game.Difficulty.values());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@Data
@Builder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
public class Game implements UuidObject {
@NonNull private String uuid;
@android.support.annotation.NonNull @PrimaryKey @NonNull private String uuid = "";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the "" default value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need it?

@ColumnInfo @NonNull private Difficulty difficulty;
@ColumnInfo @NonNull private String universe;
@ColumnInfo @NonNull private Boolean isCampaign;
@ColumnInfo @NonNull private Optional<Integer> numberOfSessions;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you forget to specify the column name? or the name attribute in lines 30 and 31 is superfluos?

public class PlayerJoinGameRequest {
@NonNull private String joinRequestId;
@android.support.annotation.NonNull @PrimaryKey @NonNull private String joinRequestId = "";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the default value

@NonNull private String userUuid;
@NonNull private String username;
@ColumnInfo
@android.support.annotation.NonNull @PrimaryKey @NonNull private String username = "";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the default value

@NonNull private String userUuid;
@NonNull private String sessionToken;
@PrimaryKey @android.support.annotation.NonNull @NonNull private String sessionToken = "";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the default value

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants