001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.data.gpx; 003 004import java.util.Objects; 005 006/** 007 * Correlation settings used by {@link GpxImageCorrelation}. 008 * @since 18061 009 */ 010public class GpxImageCorrelationSettings { 011 012 private final long offset; 013 private final boolean forceTags; 014 private final GpxImageDirectionPositionSettings directionPositionSettings; 015 016 /** 017 * Constructs a new {@code GpxImageCorrelationSettings}. 018 * @param offset offset in milliseconds 019 * @param forceTags force tagging of all photos, otherwise prefs are used 020 */ 021 public GpxImageCorrelationSettings(long offset, boolean forceTags) { 022 this(offset, forceTags, new GpxImageDirectionPositionSettings(false, 0, 0, 0, 0)); 023 } 024 025 /** 026 * Constructs a new {@code GpxImageCorrelationSettings}. 027 * @param offset offset in milliseconds 028 * @param forceTags force tagging of all photos, otherwise prefs are used 029 * @param directionPositionSettings direction/position settings 030 */ 031 public GpxImageCorrelationSettings(long offset, boolean forceTags, 032 GpxImageDirectionPositionSettings directionPositionSettings) { 033 this.offset = offset; 034 this.forceTags = forceTags; 035 this.directionPositionSettings = Objects.requireNonNull(directionPositionSettings); 036 } 037 038 /** 039 * Returns the offset in milliseconds. 040 * @return the offset in milliseconds 041 */ 042 public long getOffset() { 043 return offset; 044 } 045 046 /** 047 * Determines if tagging of all photos must be forced, otherwise prefs are used 048 * @return {@code true} if tagging of all photos must be forced, otherwise prefs are used 049 */ 050 public boolean isForceTags() { 051 return forceTags; 052 } 053 054 /** 055 * Returns the direction/position settings. 056 * @return the direction/position settings 057 */ 058 public GpxImageDirectionPositionSettings getDirectionPositionSettings() { 059 return directionPositionSettings; 060 } 061 062 @Override 063 public String toString() { 064 return "[offset=" + offset + ", forceTags=" + forceTags 065 + ", directionPositionSettings=" + directionPositionSettings + ']'; 066 } 067}