
com.dulanywebsite.sharedresources.entities.Connection.Game.GameMembership Maven / Gradle / Ivy
package com.dulanywebsite.sharedresources.entities.Connection.Game;
import com.dulanywebsite.sharedresources.entities.DuWebEntity;
import com.dulanywebsite.sharedresources.exceptions.InvalidEntityException;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
public abstract class GameMembership extends DuWebEntity {
private Long user;
private Long game;
@Override
public void UpdateEntity(String propertyName, Object updateValue) throws NoSuchFieldException, IllegalAccessException {
if (propertyName.equals("id")) {
throw new IllegalArgumentException("This property cannot be updated: " + propertyName);
}
getClass().getDeclaredField(propertyName).set(this, updateValue);
}
@Override
public void ValidateSub() throws InvalidEntityException {
if (user == null || game == null) {
throw new InvalidEntityException(this.getClass().toString() + " class has a null value that shouldn't be null");
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy