@Override public <U> Page<U> map(final Function<? super T, ? extends U> pconverter) { return new DeserializeablePage<>(this.getConvertedContent(pconverter), getPageable(), this.totalElements); }
@Override public boolean hasPrevious() { return getNumber() > 0; }
@Override public boolean hasNext() { return getNumber() + 1 < this.getTotalPages(); }
public PageImpl<T> pageImpl() { return new PageImpl<>(getContent(), PageRequest.of(getNumber(), getSize(), getSort()), getTotalElements()); }
private ValidationResultInterface processFieldErrors(final List<FieldError> pfieldErrors) { final ValidationResultInterface validationResult = new ValidationResultData(); validationResult.getValidationErrorSet() .addAll(pfieldErrors.stream().map( fieldError -> new ValidationDto(fieldError.getDefaultMessage(), fieldError.getField())) .collect(Collectors.toList())); return validationResult; } }
@RequestMapping(value = PhoneNumber.PARSE_WITH_POS, method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) @PermitAll @ResponseBody public ValueWithPos<PhoneNumberData> parsePhoneNumber( @RequestBody final ValueWithPosAndCountry<String> pphoneNumber) { return phoneNumberUtil.parsePhoneNumber(pphoneNumber, pphoneNumber.getCountry()); }
/** * Applies the given {@link Function} to the content of the {@link Chunk}. * * @param converter must not be {@literal null}. * @param <U> type of the entries * @return list of converted entries */ protected <U> List<U> getConvertedContent(final Function<? super T, ? extends U> converter) { Assert.notNull(converter, "Function must not be null!"); return stream().map(converter::apply).collect(Collectors.toList()); } }
public PageImpl<T> pageImpl() { return new PageImpl<>(getContent(), PageRequest.of(getNumber(), getSize(), getSort()), getTotalElements()); }
private ValidationResultInterface processFieldErrors(final List<FieldError> pfieldErrors) { final ValidationResultInterface validationResult = new ValidationResultData(); validationResult.getValidationErrorSet() .addAll(pfieldErrors.stream().map( fieldError -> new ValidationDto(fieldError.getDefaultMessage(), fieldError.getField())) .collect(Collectors.toList())); return validationResult; } }
@Override public <U> Page<U> map(final Function<? super T, ? extends U> pconverter) { return new DeserializeablePage<>(this.getConvertedContent(pconverter), getPageable(), this.totalElements); }
@Override public boolean hasNext() { return getNumber() + 1 < this.getTotalPages(); }
@RequestMapping(value = PhoneNumber.FORMAT_DIN5008_NATIONAL_WITH_POS, method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) @PermitAll @ResponseBody public ValueWithPos<String> formatDin5008NationalWithPos( @RequestBody final ValueWithPosAndCountry<String> pphoneNumber) { return phoneNumberUtil.formatDin5008NationalWithPos(pphoneNumber, pphoneNumber.getCountry()); }
@Override public boolean hasPrevious() { return getNumber() > 0; }
/** * Applies the given {@link Function} to the content of the {@link Chunk}. * * @param converter must not be {@literal null}. * @param <U> type of the entries * @return list of converted entries */ protected <U> List<U> getConvertedContent(final Function<? super T, ? extends U> converter) { Assert.notNull(converter, "Function must not be null!"); return stream().map(converter::apply).collect(Collectors.toList()); } }
@RequestMapping(value = PhoneNumber.FORMAT_COMMON_INTERNATIONAL_WITH_POS, method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) @PermitAll @ResponseBody public ValueWithPos<String> formatCommonInternationalWithPos( @RequestBody final ValueWithPosAndCountry<String> pphoneNumber) { return phoneNumberUtil.formatCommonInternationalWithPos(pphoneNumber, pphoneNumber.getCountry()); }
@RequestMapping(value = PhoneNumber.FORMAT_DIN5008_NATIONAL_WITH_POS, method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) @PermitAll @ResponseBody public ValueWithPos<String> formatDin5008NationalWithPos( @RequestBody final ValueWithPosAndCountry<String> pphoneNumber) { return phoneNumberUtil.formatDin5008NationalWithPos(pphoneNumber, pphoneNumber.getCountry()); }
@RequestMapping(value = PhoneNumber.FORMAT_COMMON_WITH_POS, method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) @PermitAll @ResponseBody public ValueWithPos<String> formatCommonWithPos( @RequestBody final ValueWithPosAndCountry<String> pphoneNumber) { return phoneNumberUtil.formatCommonWithPos(pphoneNumber, pphoneNumber.getCountry()); }
@RequestMapping(value = PhoneNumber.FORMAT_COMMON_NATIONAL_WITH_POS, method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) @PermitAll @ResponseBody public ValueWithPos<String> formatCommonNationalWithPos( @RequestBody final ValueWithPosAndCountry<String> pphoneNumber) { return phoneNumberUtil.formatCommonNationalWithPos(pphoneNumber, pphoneNumber.getCountry()); }