Commit cabb31c9 authored by Karakas's avatar Karakas
Browse files

Merge branch 'devbackend' into 'master'

Merge Maximus

See merge request !4
parents 888289d4 249ac5e3
package io.swagger.api;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.model.InlineResponse200;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-06-04T09:41:03.559554872Z[GMT]")
@RestController
public class HistoricalweatherApiController implements HistoricalweatherApi {
private static final Logger log = LoggerFactory.getLogger(HistoricalweatherApiController.class);
private final ObjectMapper objectMapper;
@SuppressWarnings("unused")
private final HttpServletRequest request;
@org.springframework.beans.factory.annotation.Autowired
public HistoricalweatherApiController(ObjectMapper objectMapper, HttpServletRequest request) {
this.objectMapper = objectMapper;
this.request = request;
}
public ResponseEntity<InlineResponse200> historicalWeatherData(
@NotNull @Parameter(in = ParameterIn.QUERY, description = "Latitude of the location", required = true, schema = @Schema()) @Valid @RequestParam(value = "latitude", required = true) Float latitude,
@NotNull @Parameter(in = ParameterIn.QUERY, description = "Longitude of the location", required = true, schema = @Schema()) @Valid @RequestParam(value = "longitude", required = true) Float longitude,
@NotNull @Parameter(in = ParameterIn.QUERY, description = "The time interval to get weather data. A day must be specified as an ISO8601 date (e.g. 2022-12-31).", required = true, schema = @Schema()) @Valid @RequestParam(value = "start_date", required = true) String start_date,
@NotNull @Parameter(in = ParameterIn.QUERY, description = "The time interval to get weather data. A day must be specified as an ISO8601 date (e.g. 2022-12-31).", required = true, schema = @Schema()) @Valid @RequestParam(value = "end_date", required = true) String end_date,
@Parameter(in = ParameterIn.QUERY, description = "If fahrenheit is set, all temperature values are converted to Fahrenheit.", required = true, schema = @Schema()) @Valid @RequestParam(value = "temperature_unit", required = true) String temperature_unit,
@Parameter(in = ParameterIn.QUERY, description = "Other wind speed speed units: ms, mph and kn", required = true, schema = @Schema()) @Valid @RequestParam(value = "wind_speed_unit", required = true) String wind_speed_unit,
@Parameter(in = ParameterIn.QUERY, description = "Other precipitation amount units: inch", required = true, schema = @Schema()) @Valid @RequestParam(value = "precipitation_unit", required = true) String precipitation_unit,
@Parameter(in = ParameterIn.QUERY, description = "If timezone is set, all timestamps are returned as local-time and data is returned starting at 00:00 local-time. Any time zone name from the time zone database is supported If auto is set as a time zone, the coordinates will be automatically resolved to the local time zone. For multiple coordinates, a comma separated list of timezones can be specified.", required = false, schema = @Schema()) @Valid @RequestParam(value = "timezone", required = false) String timezone,
@Parameter(in = ParameterIn.QUERY, description = "filter parameter hourly", required = false, schema = @Schema()) @Valid @RequestParam(value = "filterHourly", required = false) String filterHourly,
@Parameter(in = ParameterIn.QUERY, description = "filter parameter daily", required = false, schema = @Schema()) @Valid @RequestParam(value = "filterDaily", required = false) String filterDaily
) {
try {
RestTemplate restTemplate = new RestTemplate();
ApiService apiService = new ApiService(restTemplate);
// Test Url:
// http://localhost:8080/historicalweather?latitude=48.7823&longitude=9.177&start_date=2024-05-24&end_date=2024-06-07&filterHourly=precipitation,temperature_2m&filterDaily=precipitation_sum,temperature_2m_max&temperature_unit=celsius&wind_speed_unit=kmh&precipitation_unit=mm
String data = apiService.getDataFromFirstApi(
"https://archive-api.open-meteo.com/v1/archive?latitude=" + latitude + "&longitude=" + longitude
+ "&start_date=" + start_date + "&end_date=" + end_date
+ "&hourly=" + filterHourly + "&daily=" + filterDaily + "&temperature_unit="
+ temperature_unit + "&wind_speed_unit=" + wind_speed_unit + "&precipitation_unit="
+ precipitation_unit);
ResponseEntity<InlineResponse200> response = new ResponseEntity<InlineResponse200>(objectMapper.readValue(
data, InlineResponse200.class), HttpStatus.ACCEPTED);
return response;
} catch (IOException e) {
log.error("Couldn't serialize response for content type application/json", e);
return new ResponseEntity<InlineResponse200>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}
}
package io.swagger.api;
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-06-04T09:41:03.559554872Z[GMT]")
public class NotFoundException extends ApiException {
@SuppressWarnings("unused")
private int code;
public NotFoundException(int code, String msg) {
super(code, msg);
this.code = code;
}
}
package io.swagger.api;
import io.swagger.model.Search;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.media.ArraySchema;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.List;
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-06-09T14:41:38.246173275Z[GMT]")
@Validated
public interface SearchApi {
@Operation(summary = "Get all locations", description = "", tags = {})
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "A list of locations", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Search.class)))) })
@RequestMapping(value = "/search", produces = { "application/json" }, method = RequestMethod.GET)
ResponseEntity<List<Search>> searchGet(
@NotNull @Parameter(in = ParameterIn.QUERY, description = "Name of the city to filter locations by", required = true, schema = @Schema()) @Valid @RequestParam(value = "city", required = true) String city);
}
package io.swagger.api;
import io.swagger.model.Search;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Schema;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.bind.annotation.RequestParam;
import javax.validation.Valid;
import javax.validation.constraints.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-06-09T14:41:38.246173275Z[GMT]")
@RestController
public class SearchApiController implements SearchApi {
private static final Logger log = LoggerFactory.getLogger(SearchApiController.class);
private final ObjectMapper objectMapper;
@SuppressWarnings("unused")
private final HttpServletRequest request;
@org.springframework.beans.factory.annotation.Autowired
public SearchApiController(ObjectMapper objectMapper, HttpServletRequest request) {
this.objectMapper = objectMapper;
this.request = request;
}
public ResponseEntity<List<Search>> searchGet(
@NotNull @Parameter(in = ParameterIn.QUERY, description = "Name of the city to filter locations by", required = true, schema = @Schema()) @Valid @RequestParam(value = "city", required = true) String city) {
try {
RestTemplate restTemplate = new RestTemplate();
ApiService apiService = new ApiService(restTemplate);
String data = apiService.getDataFromFirstApi(
"http://api.weatherapi.com/v1/search.json?key=1244099aeaee4b179e6111803241304&q=" + city);
@SuppressWarnings("unchecked")
ResponseEntity<List<Search>> response = new ResponseEntity<List<Search>>(objectMapper.readValue(
data, List.class), HttpStatus.ACCEPTED);
return response;
} catch (IOException e) {
log.error("Couldn't serialize response for content type application/json", e);
return new ResponseEntity<List<Search>>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}
}
package io.swagger.configuration;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonTokenId;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils;
import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase;
import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction;
import com.fasterxml.jackson.datatype.threetenbp.function.Function;
import org.threeten.bp.DateTimeException;
import org.threeten.bp.DateTimeUtils;
import org.threeten.bp.Instant;
import org.threeten.bp.OffsetDateTime;
import org.threeten.bp.ZoneId;
import org.threeten.bp.ZonedDateTime;
import org.threeten.bp.format.DateTimeFormatter;
import org.threeten.bp.temporal.Temporal;
import org.threeten.bp.temporal.TemporalAccessor;
import java.io.IOException;
import java.math.BigDecimal;
/**
* Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime},
* and {@link ZonedDateTime}s.
* Adapted from the jackson threetenbp InstantDeserializer to add support for
* deserializing rfc822 format.
*
* @author Nick Williams
*/
public class CustomInstantDeserializer<T extends Temporal>
extends ThreeTenDateTimeDeserializerBase<T> {
private static final long serialVersionUID = 1L;
public static final CustomInstantDeserializer<Instant> INSTANT = new CustomInstantDeserializer<Instant>(
Instant.class, DateTimeFormatter.ISO_INSTANT,
new Function<TemporalAccessor, Instant>() {
@Override
public Instant apply(TemporalAccessor temporalAccessor) {
return Instant.from(temporalAccessor);
}
},
new Function<FromIntegerArguments, Instant>() {
@Override
public Instant apply(FromIntegerArguments a) {
return Instant.ofEpochMilli(a.value);
}
},
new Function<FromDecimalArguments, Instant>() {
@Override
public Instant apply(FromDecimalArguments a) {
return Instant.ofEpochSecond(a.integer, a.fraction);
}
},
null);
public static final CustomInstantDeserializer<OffsetDateTime> OFFSET_DATE_TIME = new CustomInstantDeserializer<OffsetDateTime>(
OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME,
new Function<TemporalAccessor, OffsetDateTime>() {
@Override
public OffsetDateTime apply(TemporalAccessor temporalAccessor) {
return OffsetDateTime.from(temporalAccessor);
}
},
new Function<FromIntegerArguments, OffsetDateTime>() {
@Override
public OffsetDateTime apply(FromIntegerArguments a) {
return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId);
}
},
new Function<FromDecimalArguments, OffsetDateTime>() {
@Override
public OffsetDateTime apply(FromDecimalArguments a) {
return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId);
}
},
new BiFunction<OffsetDateTime, ZoneId, OffsetDateTime>() {
@Override
public OffsetDateTime apply(OffsetDateTime d, ZoneId z) {
return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime()));
}
});
public static final CustomInstantDeserializer<ZonedDateTime> ZONED_DATE_TIME = new CustomInstantDeserializer<ZonedDateTime>(
ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME,
new Function<TemporalAccessor, ZonedDateTime>() {
@Override
public ZonedDateTime apply(TemporalAccessor temporalAccessor) {
return ZonedDateTime.from(temporalAccessor);
}
},
new Function<FromIntegerArguments, ZonedDateTime>() {
@Override
public ZonedDateTime apply(FromIntegerArguments a) {
return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId);
}
},
new Function<FromDecimalArguments, ZonedDateTime>() {
@Override
public ZonedDateTime apply(FromDecimalArguments a) {
return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId);
}
},
new BiFunction<ZonedDateTime, ZoneId, ZonedDateTime>() {
@Override
public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) {
return zonedDateTime.withZoneSameInstant(zoneId);
}
});
protected final Function<FromIntegerArguments, T> fromMilliseconds;
protected final Function<FromDecimalArguments, T> fromNanoseconds;
protected final Function<TemporalAccessor, T> parsedToValue;
protected final BiFunction<T, ZoneId, T> adjust;
protected CustomInstantDeserializer(Class<T> supportedType,
DateTimeFormatter parser,
Function<TemporalAccessor, T> parsedToValue,
Function<FromIntegerArguments, T> fromMilliseconds,
Function<FromDecimalArguments, T> fromNanoseconds,
BiFunction<T, ZoneId, T> adjust) {
super(supportedType, parser);
this.parsedToValue = parsedToValue;
this.fromMilliseconds = fromMilliseconds;
this.fromNanoseconds = fromNanoseconds;
this.adjust = adjust == null ? new BiFunction<T, ZoneId, T>() {
@Override
public T apply(T t, ZoneId zoneId) {
return t;
}
} : adjust;
}
@SuppressWarnings("unchecked")
protected CustomInstantDeserializer(CustomInstantDeserializer<T> base, DateTimeFormatter f) {
super((Class<T>) base.handledType(), f);
parsedToValue = base.parsedToValue;
fromMilliseconds = base.fromMilliseconds;
fromNanoseconds = base.fromNanoseconds;
adjust = base.adjust;
}
@Override
protected JsonDeserializer<T> withDateFormat(DateTimeFormatter dtf) {
if (dtf == _formatter) {
return this;
}
return new CustomInstantDeserializer<T>(this, dtf);
}
@SuppressWarnings("deprecation")
@Override
public T deserialize(JsonParser parser, DeserializationContext context) throws IOException {
// NOTE: Timestamps contain no timezone info, and are always in configured TZ.
// Only
// string values have to be adjusted to the configured TZ.
switch (parser.getCurrentTokenId()) {
case JsonTokenId.ID_NUMBER_FLOAT: {
BigDecimal value = parser.getDecimalValue();
long seconds = value.longValue();
int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds);
return fromNanoseconds.apply(new FromDecimalArguments(
seconds, nanoseconds, getZone(context)));
}
case JsonTokenId.ID_NUMBER_INT: {
long timestamp = parser.getLongValue();
if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) {
return this.fromNanoseconds.apply(new FromDecimalArguments(
timestamp, 0, this.getZone(context)));
}
return this.fromMilliseconds.apply(new FromIntegerArguments(
timestamp, this.getZone(context)));
}
case JsonTokenId.ID_STRING: {
String string = parser.getText().trim();
if (string.length() == 0) {
return null;
}
if (string.endsWith("+0000")) {
string = string.substring(0, string.length() - 5) + "Z";
}
T value;
try {
TemporalAccessor acc = _formatter.parse(string);
value = parsedToValue.apply(acc);
if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) {
return adjust.apply(value, this.getZone(context));
}
} catch (DateTimeException e) {
throw _peelDTE(e);
}
return value;
}
}
throw context.mappingException("Expected type float, integer, or string.");
}
private ZoneId getZone(DeserializationContext context) {
// Instants are always in UTC, so don't waste compute cycles
return (_valueClass == Instant.class) ? null : DateTimeUtils.toZoneId(context.getTimeZone());
}
private static class FromIntegerArguments {
public final long value;
public final ZoneId zoneId;
private FromIntegerArguments(long value, ZoneId zoneId) {
this.value = value;
this.zoneId = zoneId;
}
}
private static class FromDecimalArguments {
public final long integer;
public final int fraction;
public final ZoneId zoneId;
private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) {
this.integer = integer;
this.fraction = fraction;
this.zoneId = zoneId;
}
}
}
package io.swagger.configuration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* Home redirection to swagger api documentation
*/
@Controller
public class HomeController {
@RequestMapping(value = "/")
public String index() {
return "redirect:/swagger-ui/";
}
}
package io.swagger.configuration;
import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.threeten.bp.Instant;
import org.threeten.bp.OffsetDateTime;
import org.threeten.bp.ZonedDateTime;
@Configuration
public class JacksonConfiguration {
@Bean
@ConditionalOnMissingBean(ThreeTenModule.class)
ThreeTenModule threeTenModule() {
ThreeTenModule module = new ThreeTenModule();
module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT);
module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME);
module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME);
return module;
}
}
package io.swagger.configuration;
import org.springframework.core.convert.converter.Converter;
import org.threeten.bp.LocalDate;
import org.threeten.bp.format.DateTimeFormatter;
public class LocalDateConverter implements Converter<String, LocalDate> {
private final DateTimeFormatter formatter;
public LocalDateConverter(String dateFormat) {
this.formatter = DateTimeFormatter.ofPattern(dateFormat);
}
@Override
public LocalDate convert(String source) {
if(source == null || source.isEmpty()) {
return null;
}
return LocalDate.parse(source, this.formatter);
}
}
package io.swagger.configuration;
import org.springframework.core.convert.converter.Converter;
import org.threeten.bp.LocalDateTime;
import org.threeten.bp.format.DateTimeFormatter;
public class LocalDateTimeConverter implements Converter<String, LocalDateTime> {
private final DateTimeFormatter formatter;
public LocalDateTimeConverter(String dateFormat) {
this.formatter = DateTimeFormatter.ofPattern(dateFormat);
}
@Override
public LocalDateTime convert(String source) {
if(source == null || source.isEmpty()) {
return null;
}
return LocalDateTime.parse(source, this.formatter);
}
}
package io.swagger.configuration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-06-04T09:41:03.559554872Z[GMT]")
@Configuration
public class SwaggerDocumentationConfig {
@Bean
public OpenAPI openApi() {
return new OpenAPI()
.info(new Info()
.title("OpenWeatherMap API")
.description("Sample OpenWeather API.")
.termsOfService("")
.version("1.0")
.license(new License()
.name("")
.url("http://unlicense.org"))
.contact(new io.swagger.v3.oas.models.info.Contact()
.email("")));
}
}
package io.swagger.configuration;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-06-04T09:41:03.559554872Z[GMT]")
@Configuration
public class SwaggerUiConfiguration implements WebMvcConfigurer {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/swagger-ui/").setViewName("forward:/swagger-ui/index.html");
}
}
This diff is collapsed.
package io.swagger.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.*;
/**
* Astro
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2024-06-06T14:20:51.790816423Z[GMT]")
@JsonInclude(Include.NON_NULL)
public class Astro {
@JsonProperty("sunrise")
private String sunrise = null;
@JsonProperty("sunset")
private String sunset = null;
@JsonProperty("moonrise")
private String moonrise = null;
@JsonProperty("moonset")
private String moonset = null;
@JsonProperty("moon_phase")
private String moonPhase = null;
@JsonProperty("moon_illumination")
private String moonIllumination = null;
public Astro sunrise(String sunrise) {
this.sunrise = sunrise;
return this;
}
/**
* Get sunrise
*
* @return sunrise
**/
@Schema(description = "")
@NotNull
public String getSunrise() {
return sunrise;
}
public void setSunrise(String sunrise) {
this.sunrise = sunrise;
}
public Astro sunset(String sunset) {
this.sunset = sunset;
return this;
}
/**
* Get sunset
*
* @return sunset
**/
@Schema(description = "")
@NotNull
public String getSunset() {
return sunset;
}
public void setSunset(String sunset) {
this.sunset = sunset;
}
public Astro moonrise(String moonrise) {
this.moonrise = moonrise;
return this;
}
/**
* Get moonrise
*
* @return moonrise
**/
@Schema(description = "")
@NotNull
public String getMoonrise() {
return moonrise;
}
public void setMoonrise(String moonrise) {
this.moonrise = moonrise;
}
public Astro moonset(String moonset) {
this.moonset = moonset;
return this;
}
/**
* Get moonset
*
* @return moonset
**/
@Schema(description = "")
@NotNull
public String getMoonset() {
return moonset;
}
public void setMoonset(String moonset) {
this.moonset = moonset;
}
public Astro moonPhase(String moonPhase) {
this.moonPhase = moonPhase;
return this;
}
/**
* Get moonPhase
*
* @return moonPhase
**/
@Schema(description = "")
@NotNull
public String getMoonPhase() {
return moonPhase;
}
public void setMoonPhase(String moonPhase) {
this.moonPhase = moonPhase;
}
public Astro moonIllumination(String moonIllumination) {
this.moonIllumination = moonIllumination;
return this;
}
/**
* Get moonIllumination
*
* @return moonIllumination
**/
@Schema(description = "")
@NotNull
public String getMoonIllumination() {
return moonIllumination;
}
public void setMoonIllumination(String moonIllumination) {
this.moonIllumination = moonIllumination;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Astro astro = (Astro) o;
return Objects.equals(this.sunrise, astro.sunrise) &&
Objects.equals(this.sunset, astro.sunset) &&
Objects.equals(this.moonrise, astro.moonrise) &&
Objects.equals(this.moonset, astro.moonset) &&
Objects.equals(this.moonPhase, astro.moonPhase) &&
Objects.equals(this.moonIllumination, astro.moonIllumination);
}
@Override
public int hashCode() {
return Objects.hash(sunrise, sunset, moonrise, moonset, moonPhase, moonIllumination);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Astro {\n");
sb.append(" sunrise: ").append(toIndentedString(sunrise)).append("\n");
sb.append(" sunset: ").append(toIndentedString(sunset)).append("\n");
sb.append(" moonrise: ").append(toIndentedString(moonrise)).append("\n");
sb.append(" moonset: ").append(toIndentedString(moonset)).append("\n");
sb.append(" moonPhase: ").append(toIndentedString(moonPhase)).append("\n");
sb.append(" moonIllumination: ").append(toIndentedString(moonIllumination)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment