All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nannoq.tools.auth.utils.AuthorizationConverter Maven / Gradle / Ivy

There is a newer version: 1.1.7
Show newest version
/*
 * Copyright 2014 Red Hat, Inc.
 *
 * Red Hat licenses this file to you under the Apache License, version 2.0
 * (the "License"); you may not use this file except in compliance with the
 * License.  You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package com.nannoq.tools.auth.utils;

import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;

/**
 * Converter for {@link com.nannoq.tools.auth.utils.Authorization}.
 *
 * NOTE: This class has been automatically generated from the {@link com.nannoq.tools.auth.utils.Authorization} original class using Vert.x codegen.
 */
public class AuthorizationConverter {

  public static void fromJson(JsonObject json, Authorization obj) {
    if (json.getValue("domainIdentifier") instanceof String) {
      obj.setDomainIdentifier((String)json.getValue("domainIdentifier"));
    }
    if (json.getValue("method") instanceof String) {
      obj.setMethod((String)json.getValue("method"));
    }
    if (json.getValue("model") instanceof String) {
      obj.setModel((String)json.getValue("model"));
    }
  }

  public static void toJson(Authorization obj, JsonObject json) {
    if (obj.getDomainIdentifier() != null) {
      json.put("domainIdentifier", obj.getDomainIdentifier());
    }
    if (obj.getMethod() != null) {
      json.put("method", obj.getMethod());
    }
    if (obj.getModel() != null) {
      json.put("model", obj.getModel());
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy