Shorten method name
This commit is contained in:
parent
871bb04451
commit
daae2f7a3a
@ -33,7 +33,7 @@ public class Report
|
||||
_category = category;
|
||||
}
|
||||
|
||||
public Optional<Long> getReportId()
|
||||
public Optional<Long> getId()
|
||||
{
|
||||
return Optional.ofNullable(_reportId);
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ public class ReportManager
|
||||
Preconditions.checkNotNull(report);
|
||||
Preconditions.checkNotNull(reportHandler);
|
||||
|
||||
Optional<Long> reportIdOptional = report.getReportId();
|
||||
Optional<Long> reportIdOptional = report.getId();
|
||||
Preconditions.checkArgument(reportIdOptional.isPresent(), "Report id is not present.");
|
||||
long reportId = reportIdOptional.get();
|
||||
|
||||
@ -348,7 +348,7 @@ public class ReportManager
|
||||
|
||||
public static String getReportPrefix(Report report)
|
||||
{
|
||||
Optional<Long> reportIdOptional = report.getReportId();
|
||||
Optional<Long> reportIdOptional = report.getId();
|
||||
|
||||
if (reportIdOptional.isPresent())
|
||||
{
|
||||
|
@ -335,7 +335,7 @@ public class ReportRepository extends MinecraftRepository
|
||||
{
|
||||
try (Connection connection = DBPool.getAccount().getConnection())
|
||||
{
|
||||
if (!report.getReportId().isPresent())
|
||||
if (!report.getId().isPresent())
|
||||
{
|
||||
PreparedStatement preparedStatement = connection.prepareStatement(INSERT_REPORT, Statement.RETURN_GENERATED_KEYS);
|
||||
preparedStatement.setInt(1, report.getSuspectId());
|
||||
@ -347,13 +347,13 @@ public class ReportRepository extends MinecraftRepository
|
||||
{
|
||||
report._reportId = resultSet.getLong(1);
|
||||
}
|
||||
else if (!report.getReportId().isPresent())
|
||||
else if (!report.getId().isPresent())
|
||||
{
|
||||
throw new IllegalStateException("Query did not return a report id (we need one).");
|
||||
}
|
||||
}
|
||||
|
||||
Optional<Long> idOptional = report.getReportId();
|
||||
Optional<Long> idOptional = report.getId();
|
||||
|
||||
if (idOptional.isPresent())
|
||||
{
|
||||
|
@ -16,7 +16,7 @@ public class ReportHandlerNotification extends ReportNotification
|
||||
{
|
||||
super(notification);
|
||||
|
||||
_reportId = report.getReportId().orElseThrow(() -> new IllegalStateException("Report has no id set."));
|
||||
_reportId = report.getId().orElseThrow(() -> new IllegalStateException("Report has no id set."));
|
||||
_handlerId = report.getHandlerId().orElseThrow(() -> new IllegalStateException("Report has no handler."));
|
||||
|
||||
setTargetServers(getServersInvolved(report));
|
||||
|
@ -33,7 +33,7 @@ public class ReportHandlerMessageTask extends BukkitRunnable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
long reportId = _report.getReportId().orElse((long) -1);
|
||||
long reportId = _report.getId().orElse((long) -1);
|
||||
|
||||
_reportManager.isActiveReport(_report).thenAccept(isActive ->
|
||||
{
|
||||
|
@ -62,7 +62,7 @@ public class ReportCategoryPage extends SimpleGui
|
||||
|
||||
if (report != null)
|
||||
{
|
||||
Optional<Long> reportIdOptional = report.getReportId();
|
||||
Optional<Long> reportIdOptional = report.getId();
|
||||
|
||||
if (reportIdOptional.isPresent())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user