Skip to content

Commit

Permalink
Fixes to NonNull annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
arunvasudevan committed Mar 4, 2021
1 parent 0b8eddf commit 5fc4f9b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.linkedin.datahub.graphql.types.common.mappers;

import javax.annotation.Nonnull;

import com.linkedin.common.AuditStamp;
import com.linkedin.common.InstitutionalMemoryMetadata;
import com.linkedin.common.url.Url;
Expand All @@ -11,12 +13,12 @@ public class InstitutionalMemoryMetadataUpdateMapper implements ModelMapper<Inst

private static final InstitutionalMemoryMetadataUpdateMapper INSTANCE = new InstitutionalMemoryMetadataUpdateMapper();

public static InstitutionalMemoryMetadata map(InstitutionalMemoryMetadataUpdate input) {
public static InstitutionalMemoryMetadata map(@Nonnull final InstitutionalMemoryMetadataUpdate input) {
return INSTANCE.apply(input);
}

@Override
public InstitutionalMemoryMetadata apply(InstitutionalMemoryMetadataUpdate input) {
public InstitutionalMemoryMetadata apply(@Nonnull final InstitutionalMemoryMetadataUpdate input) {
final InstitutionalMemoryMetadata metadata = new InstitutionalMemoryMetadata();
metadata.setDescription(input.getDescription());
metadata.setUrl(new Url(input.getUrl()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

import java.util.stream.Collectors;

import javax.annotation.Nonnull;

import com.linkedin.common.InstitutionalMemory;
import com.linkedin.common.InstitutionalMemoryMetadataArray;
import com.linkedin.datahub.graphql.generated.InstitutionalMemoryUpdate;
import com.linkedin.datahub.graphql.types.mappers.ModelMapper;

import lombok.NonNull;

public class InstitutionalMemoryUpdateMapper implements ModelMapper<InstitutionalMemoryUpdate, InstitutionalMemory> {

private static final InstitutionalMemoryUpdateMapper INSTANCE = new InstitutionalMemoryUpdateMapper();

public static InstitutionalMemory map(@NonNull final InstitutionalMemoryUpdate input) {
public static InstitutionalMemory map(@Nonnull final InstitutionalMemoryUpdate input) {
return INSTANCE.apply(input);
}

@Override
public InstitutionalMemory apply(@NonNull final InstitutionalMemoryUpdate input) {
public InstitutionalMemory apply(@Nonnull final InstitutionalMemoryUpdate input) {
final InstitutionalMemory institutionalMemory = new InstitutionalMemory();
institutionalMemory.setElements(new InstitutionalMemoryMetadataArray(
input.getElements()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.linkedin.datahub.graphql.types.common.mappers;

import javax.annotation.Nonnull;

import com.linkedin.common.Owner;
import com.linkedin.common.OwnershipSource;
import com.linkedin.common.OwnershipSourceType;
Expand All @@ -8,18 +10,16 @@
import com.linkedin.datahub.graphql.types.corpuser.CorpUserUtils;
import com.linkedin.datahub.graphql.types.mappers.ModelMapper;

import lombok.NonNull;

public class OwnerUpdateMapper implements ModelMapper<OwnerUpdate, Owner> {

private static final OwnerUpdateMapper INSTANCE = new OwnerUpdateMapper();

public static Owner map(@NonNull final OwnerUpdate input) {
public static Owner map(@Nonnull final OwnerUpdate input) {
return INSTANCE.apply(input);
}

@Override
public Owner apply(@NonNull final OwnerUpdate input) {
public Owner apply(@Nonnull final OwnerUpdate input) {
final Owner owner = new Owner();
owner.setOwner(CorpUserUtils.getCorpUserUrn(input.getOwner()));
owner.setType(OwnershipType.valueOf(input.getType().toString()));
Expand Down

0 comments on commit 5fc4f9b

Please sign in to comment.