Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds periodAndDuration constructor using a periodAndDuration value. #577

Merged
merged 2 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

## [0.7.1] - 2023-08-21

### Changed

- Add PeriodAndDuration constructor to create new object from a PeriodAndDuration object.

## [0.7.0] - 2023-08-18

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public Period getPeriod() {
public Duration getDuration() {
return duration;
}

/**
* Non-public Constructor for PeriodAndDuration
* @param period The {@code Period} component of the aggregate type
Expand All @@ -72,7 +71,6 @@ private PeriodAndDuration(@Nonnull Period period, @Nonnull Duration duration) {
this.period = period;
this.duration = duration;
}

/**
* Creates an instance based on a period and duration.
* @param period the {@code Period}, not null
Expand All @@ -85,7 +83,6 @@ public static PeriodAndDuration of(@Nonnull Period period, @Nonnull Duration dur
Objects.requireNonNull(duration, "parameter duration cannot be null");
return new PeriodAndDuration(period, duration);
}

/**
* Creates an instance based on a period.
* @param period the {@code Period}, not null
Expand All @@ -96,7 +93,6 @@ public static PeriodAndDuration ofPeriod(@Nonnull Period period) {
Objects.requireNonNull(period, "parameter period cannot be null");
return new PeriodAndDuration(period, Duration.ZERO);
}

/**
* Creates an instance based on a duration.
* @param duration the {@code Duration}, not null
Expand All @@ -107,7 +103,16 @@ public static PeriodAndDuration ofDuration(@Nonnull Duration duration) {
Objects.requireNonNull(duration, "parameter duration cannot be null");
return new PeriodAndDuration(Period.ZERO, duration);
}

/**
* Creates an instance based on a PeriodAndDuration.
* @param periodAndDuration the {@code PeriodAndDuration}, not null
* @return the combined {@code PeriodAndDuration}, not null
*/
@Nonnull
public static PeriodAndDuration ofPeriodAndDuration(@Nonnull PeriodAndDuration periodAndDuration) {
Objects.requireNonNull(periodAndDuration, "parameter periodAndDuration cannot be null");
return new PeriodAndDuration(periodAndDuration.getPeriod(), periodAndDuration.getDuration());
}
/**
* @param stringValue the {@code String} parse from.
* @return parsed instance of {@code PeriodAndDuration}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public UserAgentHandlerOption() { }
@Nonnull
private String productName = "kiota-java";
@Nonnull
private String productVersion = "0.7.0";
private String productVersion = "0.7.1";
/**
* Gets the product name to be used in the user agent header
* @return the product name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public PeriodAndDuration getWorkDuration() {
}

public void setWorkDuration(PeriodAndDuration value) {
this._workDuration = PeriodAndDuration.of(value.getPeriod(), value.getDuration());
this._workDuration = PeriodAndDuration.ofPeriodAndDuration(value);
}

private LocalTime _startWorkTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public PeriodAndDuration getWorkDuration() {
}

public void setWorkDuration(PeriodAndDuration value) {
this._workDuration = PeriodAndDuration.of(value.getPeriod(), value.getDuration());
this._workDuration = PeriodAndDuration.ofPeriodAndDuration(value);
}

private LocalTime _startWorkTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public PeriodAndDuration getWorkDuration() {
}

public void setWorkDuration(PeriodAndDuration value) {
this._workDuration = PeriodAndDuration.of(value.getPeriod(), value.getDuration());
this._workDuration = PeriodAndDuration.ofPeriodAndDuration(value);
}

private LocalTime _startWorkTime;
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ org.gradle.caching=true
mavenGroupId = com.microsoft.kiota
mavenMajorVersion = 0
mavenMinorVersion = 7
mavenPatchVersion = 0
mavenPatchVersion = 1
mavenArtifactSuffix =

#These values are used to run functional tests
Expand Down