mirror of https://github.com/apache/archiva.git
ease json mapping for js code
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1402488 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8146f7ea37
commit
9a77a9926c
|
@ -21,7 +21,9 @@ package org.apache.archiva.admin.model.beans;
|
|||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
@ -73,6 +75,13 @@ public class RemoteRepository
|
|||
*/
|
||||
private Map<String, String> extraParameters;
|
||||
|
||||
/**
|
||||
* field to ease json mapping wrapper on <code>extraParameters</code> field
|
||||
*
|
||||
* @since 1.4-M4
|
||||
*/
|
||||
private List<PropertyEntry> extraParametersEntries;
|
||||
|
||||
/**
|
||||
* extraHeaders.
|
||||
*
|
||||
|
@ -80,6 +89,13 @@ public class RemoteRepository
|
|||
*/
|
||||
private Map<String, String> extraHeaders;
|
||||
|
||||
/**
|
||||
* field to ease json mapping wrapper on <code>extraHeaders</code> field
|
||||
*
|
||||
* @since 1.4-M4
|
||||
*/
|
||||
private List<PropertyEntry> extraHeadersEntries;
|
||||
|
||||
|
||||
public RemoteRepository()
|
||||
{
|
||||
|
@ -226,6 +242,35 @@ public class RemoteRepository
|
|||
this.extraParameters = extraParameters;
|
||||
}
|
||||
|
||||
public void addExtraParameter( String key, String value )
|
||||
{
|
||||
getExtraParameters().put( key, value );
|
||||
}
|
||||
|
||||
public List<PropertyEntry> getExtraParametersEntries()
|
||||
{
|
||||
this.extraParametersEntries = new ArrayList<PropertyEntry>();
|
||||
for ( Map.Entry<String, String> entry : getExtraParameters().entrySet() )
|
||||
{
|
||||
this.extraParametersEntries.add( new PropertyEntry( entry.getKey(), entry.getValue() ) );
|
||||
}
|
||||
return this.extraParametersEntries;
|
||||
}
|
||||
|
||||
public void setExtraParametersEntries( List<PropertyEntry> extraParametersEntries )
|
||||
{
|
||||
if ( extraParametersEntries == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.extraParametersEntries = extraParametersEntries;
|
||||
for ( PropertyEntry propertyEntry : extraParametersEntries )
|
||||
{
|
||||
this.addExtraParameter( propertyEntry.getKey(), propertyEntry.getValue() );
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, String> getExtraHeaders()
|
||||
{
|
||||
if ( this.extraHeaders == null )
|
||||
|
@ -240,6 +285,36 @@ public class RemoteRepository
|
|||
this.extraHeaders = extraHeaders;
|
||||
}
|
||||
|
||||
public void addExtraHeader( String key, String value )
|
||||
{
|
||||
getExtraHeaders().put( key, value );
|
||||
}
|
||||
|
||||
public List<PropertyEntry> getExtraHeadersEntries()
|
||||
{
|
||||
this.extraHeadersEntries = new ArrayList<PropertyEntry>();
|
||||
for ( Map.Entry<String, String> entry : getExtraHeaders().entrySet() )
|
||||
{
|
||||
this.extraHeadersEntries.add( new PropertyEntry( entry.getKey(), entry.getValue() ) );
|
||||
}
|
||||
return this.extraHeadersEntries;
|
||||
}
|
||||
|
||||
public void setExtraHeadersEntries( List<PropertyEntry> extraHeadersEntries )
|
||||
{
|
||||
if ( extraHeadersEntries == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.extraHeadersEntries = extraHeadersEntries;
|
||||
for ( PropertyEntry propertyEntry : extraHeadersEntries )
|
||||
{
|
||||
this.addExtraHeader( propertyEntry.getKey(), propertyEntry.getValue() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue