Changeset View
Changeset View
Standalone View
Standalone View
src/main/java/net/wildfyre/posts/Comment.java
/* | /* | ||||
Lint: Lint: :compileJava [01;31m[KFAILED[m[K | |||||
* Copyright 2018 Wildfyre.net | * Copyright 2018 Wildfyre.net | ||||
* | * | ||||
* Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
* You may obtain a copy of the License at | * You may obtain a copy of the License at | ||||
* | * | ||||
* http://www.apache.org/licenses/LICENSE-2.0 | * http://www.apache.org/licenses/LICENSE-2.0 | ||||
▲ Show 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | public Post post(){ | ||||
throw new ProgrammingException("The post must exist."); | throw new ProgrammingException("The post must exist."); | ||||
} | } | ||||
/** | /** | ||||
* The user who created this comment. | * The user who created this comment. | ||||
* | * | ||||
* @return The User who created this comment. | * @return The User who created this comment. | ||||
*/ | */ | ||||
public User author(){ | public User author() { | ||||
return Users.get(authorID) | User u = Users.INSTANCE.get(authorID); | ||||
.orElseThrow(RuntimeException::new); // This is not possible: Author doesn't exist | if (u != null) | ||||
return u; | |||||
else throw new ProgrammingException("Impossible: the Author does not exist."); | |||||
} | } | ||||
//endregion | //endregion | ||||
//region Generated | //region Generated | ||||
@Override | @Override | ||||
public boolean equals(Object o) { | public boolean equals(Object o) { | ||||
if (this == o) return true; | if (this == o) return true; | ||||
Show All 32 Lines |
:compileJava [01;31m[KFAILED[m[K